From f42cb795fae9cd20faf6a0be5765ac2db02e3100 Mon Sep 17 00:00:00 2001 From: "0.0" <1092404103.qq.com> Date: Sat, 10 Jun 2023 16:49:58 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8A=A8=E6=80=81=E7=BB=B4=E4=BF=AE=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/entity/BasicRecordsEntity.java | 134 ++++++++++++++ .../basic/feign/IBasicRecordsClient.java | 50 ++++++ .../com/logpm/basic/vo/BasicRecordsVO.java | 40 +++++ .../controller/BasicPropertyController.java | 2 +- .../controller/BasicRecordsController.java | 150 ++++++++++++++++ .../com/logpm/basic/dto/BasicRecordsDTO.java | 34 ++++ .../logpm/basic/excel/BasicRecordsExcel.java | 166 ++++++++++++++++++ .../logpm/basic/feign/BasicRecordsClient.java | 53 ++++++ .../basic/mapper/BasicRecordsMapper.java | 54 ++++++ .../logpm/basic/mapper/BasicRecordsMapper.xml | 87 +++++++++ .../basic/service/IBasicRecordsService.java | 52 ++++++ .../service/impl/BasicRecordsServiceImpl.java | 54 ++++++ 12 files changed, 875 insertions(+), 1 deletion(-) create mode 100644 blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicRecordsEntity.java create mode 100644 blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicRecordsClient.java create mode 100644 blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicRecordsVO.java create mode 100644 blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicRecordsController.java create mode 100644 blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicRecordsDTO.java create mode 100644 blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicRecordsExcel.java create mode 100644 blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicRecordsClient.java create mode 100644 blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicRecordsMapper.java create mode 100644 blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicRecordsMapper.xml create mode 100644 blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicRecordsService.java create mode 100644 blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicRecordsServiceImpl.java diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicRecordsEntity.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicRecordsEntity.java new file mode 100644 index 000000000..b41e30be2 --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicRecordsEntity.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import java.math.BigDecimal; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 资产维修记录 实体类 + * + * @author lmy + * @since 2023-06-10 + */ +@Data +@TableName("logpm_basic_records") +@ApiModel(value = "BasicRecords对象", description = "资产维修记录") +@EqualsAndHashCode(callSuper = true) +public class BasicRecordsEntity extends TenantEntity { + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + /** + * 关联id + */ + @ApiModelProperty(value = "关联id") + private Long masterId; + /** + * 反馈日期 + */ + @ApiModelProperty(value = "反馈日期") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date feedbackTime; + /** + * 营业部 + */ + @ApiModelProperty(value = "营业部") + private String businessDepartment; + /** + * 维修品牌 + */ + @ApiModelProperty(value = "维修品牌") + private String brand; + /** + * 采买经销商 + */ + @ApiModelProperty(value = "采买经销商") + private String dealer; + /** + * 维修公司 + */ + @ApiModelProperty(value = "维修公司") + private String maintenanceCompany; + /** + * 寄检修快递单号 + */ + @ApiModelProperty(value = "寄检修快递单号") + private String repairTrackingNub; + /** + * 是否保修期; + */ + @ApiModelProperty(value = "是否保修期;") + private String isLiability; + /** + * 问题描述 + */ + @ApiModelProperty(value = "问题描述") + private String problemDescription; + /** + * 维修费用;单位(元) + */ + @ApiModelProperty(value = "维修费用;单位(元)") + private BigDecimal maintenanceCosts; + /** + * 寄回日期 + */ + @ApiModelProperty(value = "寄回日期") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date returnDate; + /** + * 维修寄回单号 + */ + @ApiModelProperty(value = "维修寄回单号") + private String returnOrderNub; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + private String notes; + +} diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicRecordsClient.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicRecordsClient.java new file mode 100644 index 000000000..db8e72ab0 --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicRecordsClient.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.feign; + +import org.springblade.common.constant.ModuleNameConstant; +import org.springblade.core.mp.support.BladePage; +import com.logpm.basic.entity.BasicRecordsEntity; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * 资产维修记录 Feign接口类 + * + * @author lmy + * @since 2023-06-10 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_BASIC_NAME +) +public interface IBasicRecordsClient { + + String API_PREFIX = "records/client"; + String TOP = API_PREFIX + "/top"; + + /** + * 获取资产维修记录列表 + * + * @param current 页号 + * @param size 页数 + * @return BladePage + */ + @GetMapping(TOP) + BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + +} diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicRecordsVO.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicRecordsVO.java new file mode 100644 index 000000000..a80419479 --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicRecordsVO.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.vo; + +import com.logpm.basic.entity.BasicRecordsEntity; +import io.swagger.annotations.ApiModelProperty; +import org.springblade.core.tool.node.INode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 资产维修记录 视图实体类 + * + * @author lmy + * @since 2023-06-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BasicRecordsVO extends BasicRecordsEntity { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "资产名称") + private String assetName; + + @ApiModelProperty(value = "资产类型") + private String assetType; +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyController.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyController.java index 2ee8c53c5..6ae680b53 100644 --- a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyController.java +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyController.java @@ -104,7 +104,6 @@ public class BasicPropertyController extends BladeController { @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入basicProperty") public R save(@Valid @RequestBody BasicPropertyDTO basicProperty) { - log.info("接收参数>>>>>>>>>>>>>>{}",basicProperty); boolean flag = basicPropertyService.save(basicProperty); if (flag){ //存入字段信息 @@ -149,6 +148,7 @@ public class BasicPropertyController extends BladeController { @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + log.info("进来了》》》》》》》》》》》"); //删除所有子表 basicPropertyfieldService.deleteByMasterId(Func.toLongList(ids)); return R.status(basicPropertyService.deleteLogic(Func.toLongList(ids))); diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicRecordsController.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicRecordsController.java new file mode 100644 index 000000000..1329b3afe --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicRecordsController.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.controller; + +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.validation.Valid; + +import org.springblade.core.secure.BladeUser; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.basic.entity.BasicRecordsEntity; +import com.logpm.basic.vo.BasicRecordsVO; +import com.logpm.basic.excel.BasicRecordsExcel; +import com.logpm.basic.service.IBasicRecordsService; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.tool.constant.BladeConstant; +import springfox.documentation.annotations.ApiIgnore; +import java.util.Map; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +/** + * 资产维修记录 控制器 + * + * @author lmy + * @since 2023-06-10 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/records") +@Api(value = "资产维修记录", tags = "资产维修记录接口") +public class BasicRecordsController extends BladeController { + + private final IBasicRecordsService basicRecordsService; + + /** + * 资产维修记录 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入basicRecords") + public R detail(BasicRecordsEntity basicRecords) { + BasicRecordsEntity detail = basicRecordsService.getOne(Condition.getQueryWrapper(basicRecords)); + return R.data(detail); + } + /** + * 资产维修记录 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入basicRecords") + public R> list(@ApiIgnore @RequestParam Map basicRecords, Query query) { + IPage pages = basicRecordsService.page(Condition.getPage(query), Condition.getQueryWrapper(basicRecords, BasicRecordsEntity.class)); + return R.data(pages); + } + + /** + * 资产维修记录 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入basicRecords") + public R> page(BasicRecordsVO basicRecords, Query query) { + IPage pages = basicRecordsService.selectBasicRecordsPage(Condition.getPage(query), basicRecords); + return R.data(pages); + } + + /** + * 资产维修记录 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入basicRecords") + public R save(@Valid @RequestBody BasicRecordsEntity basicRecords) { + return R.status(basicRecordsService.save(basicRecords)); + } + + /** + * 资产维修记录 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入basicRecords") + public R update(@Valid @RequestBody BasicRecordsEntity basicRecords) { + return R.status(basicRecordsService.updateById(basicRecords)); + } + + /** + * 资产维修记录 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入basicRecords") + public R submit(@Valid @RequestBody BasicRecordsEntity basicRecords) { + return R.status(basicRecordsService.saveOrUpdate(basicRecords)); + } + + /** + * 资产维修记录 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(basicRecordsService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-basicRecords") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入basicRecords") + public void exportBasicRecords(@ApiIgnore @RequestParam Map basicRecords, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(basicRecords, BasicRecordsEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(BasicRecords::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(BasicRecordsEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List list = basicRecordsService.exportBasicRecords(queryWrapper); + ExcelUtil.export(response, "资产维修记录数据" + DateUtil.time(), "资产维修记录数据表", list, BasicRecordsExcel.class); + } + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicRecordsDTO.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicRecordsDTO.java new file mode 100644 index 000000000..d530b5f68 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicRecordsDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.dto; + +import com.logpm.basic.entity.BasicRecordsEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 资产维修记录 数据传输对象实体类 + * + * @author lmy + * @since 2023-06-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BasicRecordsDTO extends BasicRecordsEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicRecordsExcel.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicRecordsExcel.java new file mode 100644 index 000000000..cfbfe4a8f --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicRecordsExcel.java @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.excel; + + +import lombok.Data; + +import java.util.Date; +import java.math.BigDecimal; +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 java.io.Serializable; + + +/** + * 资产维修记录 Excel实体类 + * + * @author lmy + * @since 2023-06-10 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class BasicRecordsExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 租户号 + */ + @ColumnWidth(20) + @ExcelProperty("租户号") + private String tenantId; + /** + * 是否已删除 + */ + @ColumnWidth(20) + @ExcelProperty("是否已删除") + private Integer isDeleted; + /** + * 预留1 + */ + @ColumnWidth(20) + @ExcelProperty("预留1") + private String reserve1; + /** + * 预留2 + */ + @ColumnWidth(20) + @ExcelProperty("预留2") + private String reserve2; + /** + * 预留3 + */ + @ColumnWidth(20) + @ExcelProperty("预留3") + private String reserve3; + /** + * 预留4 + */ + @ColumnWidth(20) + @ExcelProperty("预留4") + private String reserve4; + /** + * 预留5 + */ + @ColumnWidth(20) + @ExcelProperty("预留5") + private String reserve5; + /** + * 关联id + */ + @ColumnWidth(20) + @ExcelProperty("关联id") + private Long masterId; + /** + * 反馈日期 + */ + @ColumnWidth(20) + @ExcelProperty("反馈日期") + private Date feedbackTime; + /** + * 营业部 + */ + @ColumnWidth(20) + @ExcelProperty("营业部") + private String businessDepartment; + /** + * 维修品牌 + */ + @ColumnWidth(20) + @ExcelProperty("维修品牌") + private String brand; + /** + * 采买经销商 + */ + @ColumnWidth(20) + @ExcelProperty("采买经销商") + private String dealer; + /** + * 维修公司 + */ + @ColumnWidth(20) + @ExcelProperty("维修公司") + private String maintenanceCompany; + /** + * 寄检修快递单号 + */ + @ColumnWidth(20) + @ExcelProperty("寄检修快递单号") + private String repairTrackingNub; + /** + * 是否保修期; + */ + @ColumnWidth(20) + @ExcelProperty("是否保修期;") + private String isLiability; + /** + * 问题描述 + */ + @ColumnWidth(20) + @ExcelProperty("问题描述") + private String problemDescription; + /** + * 维修费用;单位(元) + */ + @ColumnWidth(20) + @ExcelProperty("维修费用;单位(元)") + private BigDecimal maintenanceCosts; + /** + * 寄回日期 + */ + @ColumnWidth(20) + @ExcelProperty("寄回日期") + private Date returnDate; + /** + * 维修寄回单号 + */ + @ColumnWidth(20) + @ExcelProperty("维修寄回单号") + private String returnOrderNub; + /** + * 备注 + */ + @ColumnWidth(20) + @ExcelProperty("备注") + private String notes; + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicRecordsClient.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicRecordsClient.java new file mode 100644 index 000000000..0fb119237 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicRecordsClient.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.feign; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import org.springblade.core.mp.support.BladePage; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import com.logpm.basic.entity.BasicRecordsEntity; +import com.logpm.basic.service.IBasicRecordsService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +/** + * 资产维修记录 Feign实现类 + * + * @author lmy + * @since 2023-06-10 + */ +@ApiIgnore() +@RestController +@AllArgsConstructor +public class BasicRecordsClient implements IBasicRecordsClient { + + private final IBasicRecordsService basicRecordsService; + + @Override + @GetMapping(TOP) + public BladePage top(Integer current, Integer size) { + Query query = new Query(); + query.setCurrent(current); + query.setSize(size); + IPage page = basicRecordsService.page(Condition.getPage(query)); + return BladePage.of(page); + } + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicRecordsMapper.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicRecordsMapper.java new file mode 100644 index 000000000..29d6be2af --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicRecordsMapper.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.mapper; + +import com.logpm.basic.entity.BasicRecordsEntity; +import com.logpm.basic.vo.BasicRecordsVO; +import com.logpm.basic.excel.BasicRecordsExcel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * 资产维修记录 Mapper 接口 + * + * @author lmy + * @since 2023-06-10 + */ +public interface BasicRecordsMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param basicRecords + * @return + */ + List selectBasicRecordsPage(IPage page,@Param("param") BasicRecordsVO basicRecords); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List exportBasicRecords(@Param("ew") Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicRecordsMapper.xml b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicRecordsMapper.xml new file mode 100644 index 000000000..b82cf9231 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicRecordsMapper.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicRecordsService.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicRecordsService.java new file mode 100644 index 000000000..5898b3a99 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicRecordsService.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.logpm.basic.entity.BasicRecordsEntity; +import com.logpm.basic.vo.BasicRecordsVO; +import com.logpm.basic.excel.BasicRecordsExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 资产维修记录 服务类 + * + * @author lmy + * @since 2023-06-10 + */ +public interface IBasicRecordsService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param basicRecords + * @return + */ + IPage selectBasicRecordsPage(IPage page, BasicRecordsVO basicRecords); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportBasicRecords(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicRecordsServiceImpl.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicRecordsServiceImpl.java new file mode 100644 index 000000000..4f6020a66 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicRecordsServiceImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basic.service.impl; + +import com.logpm.basic.entity.BasicRecordsEntity; +import com.logpm.basic.vo.BasicRecordsVO; +import com.logpm.basic.excel.BasicRecordsExcel; +import com.logpm.basic.mapper.BasicRecordsMapper; +import com.logpm.basic.service.IBasicRecordsService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * 资产维修记录 服务实现类 + * + * @author lmy + * @since 2023-06-10 + */ +@Service +public class BasicRecordsServiceImpl extends BaseServiceImpl implements IBasicRecordsService { + + @Override + public IPage selectBasicRecordsPage(IPage page, BasicRecordsVO basicRecords) { + return page.setRecords(baseMapper.selectBasicRecordsPage(page, basicRecords)); + } + + + @Override + public List exportBasicRecords(Wrapper queryWrapper) { + List basicRecordsList = baseMapper.exportBasicRecords(queryWrapper); + //basicRecordsList.forEach(basicRecords -> { + // basicRecords.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicRecords.getType())); + //}); + return basicRecordsList; + } + +}