12 changed files with 875 additions and 1 deletions
@ -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; |
||||
|
||||
} |
@ -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<BasicRecordsEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); |
||||
|
||||
} |
@ -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; |
||||
} |
@ -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<BasicRecordsEntity> 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<IPage<BasicRecordsEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicRecords, Query query) { |
||||
IPage<BasicRecordsEntity> 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<IPage<BasicRecordsVO>> page(BasicRecordsVO basicRecords, Query query) { |
||||
IPage<BasicRecordsVO> 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<String, Object> basicRecords, BladeUser bladeUser, HttpServletResponse response) { |
||||
QueryWrapper<BasicRecordsEntity> 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<BasicRecordsExcel> list = basicRecordsService.exportBasicRecords(queryWrapper); |
||||
ExcelUtil.export(response, "资产维修记录数据" + DateUtil.time(), "资产维修记录数据表", list, BasicRecordsExcel.class); |
||||
} |
||||
|
||||
} |
@ -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; |
||||
|
||||
} |
@ -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; |
||||
|
||||
} |
@ -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<BasicRecordsEntity> top(Integer current, Integer size) { |
||||
Query query = new Query(); |
||||
query.setCurrent(current); |
||||
query.setSize(size); |
||||
IPage<BasicRecordsEntity> page = basicRecordsService.page(Condition.getPage(query)); |
||||
return BladePage.of(page); |
||||
} |
||||
|
||||
} |
@ -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<BasicRecordsEntity> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param basicRecords |
||||
* @return |
||||
*/ |
||||
List<BasicRecordsVO> selectBasicRecordsPage(IPage page,@Param("param") BasicRecordsVO basicRecords); |
||||
|
||||
|
||||
/** |
||||
* 获取导出数据 |
||||
* |
||||
* @param queryWrapper |
||||
* @return |
||||
*/ |
||||
List<BasicRecordsExcel> exportBasicRecords(@Param("ew") Wrapper<BasicRecordsEntity> queryWrapper); |
||||
|
||||
} |
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.logpm.basic.mapper.BasicRecordsMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="basicRecordsResultMap" type="com.logpm.basic.entity.BasicRecordsEntity"> |
||||
<result column="id" property="id"/> |
||||
<result column="tenant_id" property="tenantId"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="status" property="status"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="create_dept" property="createDept"/> |
||||
<result column="reserve1" property="reserve1"/> |
||||
<result column="reserve2" property="reserve2"/> |
||||
<result column="reserve3" property="reserve3"/> |
||||
<result column="reserve4" property="reserve4"/> |
||||
<result column="reserve5" property="reserve5"/> |
||||
<result column="master_id" property="masterId"/> |
||||
<result column="feedback_time" property="feedbackTime"/> |
||||
<result column="business_department" property="businessDepartment"/> |
||||
<result column="brand" property="brand"/> |
||||
<result column="dealer" property="dealer"/> |
||||
<result column="maintenance_company" property="maintenanceCompany"/> |
||||
<result column="repair_tracking_nub" property="repairTrackingNub"/> |
||||
<result column="is_liability" property="isLiability"/> |
||||
<result column="problem_description" property="problemDescription"/> |
||||
<result column="maintenance_costs" property="maintenanceCosts"/> |
||||
<result column="return_date" property="returnDate"/> |
||||
<result column="return_order_nub" property="returnOrderNub"/> |
||||
<result column="notes" property="notes"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectBasicRecordsPage" resultType="com.logpm.basic.vo.BasicRecordsVO"> |
||||
SELECT |
||||
lbpr.id id, |
||||
lbpr.tenant_id tenantId, |
||||
lbpr.create_user createUser, |
||||
lbpr.create_time createTime, |
||||
lbpr.update_user updateUser, |
||||
lbpr.update_time updateTime, |
||||
lbpr.STATUS STATUS, |
||||
lbpr.create_dept createDept, |
||||
lbp.asset_name assetName, |
||||
lbp.asset_type assetType, |
||||
lbpr.master_id masterId, |
||||
lbpr.feedback_time feedbackTime, |
||||
lbpr.business_department businessDepartment, |
||||
lbpr.brand brand, |
||||
lbpr.dealer dealer, |
||||
lbpr.maintenance_company maintenanceCompany, |
||||
lbpr.repair_tracking_nub repairTrackingNub, |
||||
lbpr.is_liability isLiability, |
||||
lbpr.problem_description problemDescription, |
||||
lbpr.maintenance_costs maintenanceCosts, |
||||
lbpr.return_date returnDate, |
||||
lbpr.return_order_nub returnOrderNub, |
||||
lbpr.notes notes |
||||
FROM |
||||
logpm_basic_records lbpr |
||||
JOIN logpm_basic_propertyvalue lbpv ON lbpr.master_id = lbpv.id |
||||
JOIN logpm_basic_property lbp ON lbpv.master_id = lbp.id |
||||
<where> |
||||
lbpr.is_deleted = 0 |
||||
<if test="param.maintenanceCompany != null ">and lbpr.maintenance_company like |
||||
concat('%',#{param.maintenanceCompany},'%') |
||||
</if> |
||||
<if test="param.repairTrackingNub != null ">and lbpr.repair_tracking_nub like |
||||
concat('%',#{param.repairTrackingNub},'%') |
||||
</if> |
||||
<if test="param.returnOrderNub != null ">and lbpr.return_order_nub like |
||||
concat('%',#{param.returnOrderNub},'%') |
||||
</if> |
||||
<if test="param.assetName != null ">and lbp.asset_name like concat('%',#{param.assetName},'%')</if> |
||||
<if test="param.assetType != null ">and lbp.asset_type = #{param.assetType}</if> |
||||
</where> |
||||
</select> |
||||
|
||||
|
||||
<select id="exportBasicRecords" resultType="com.logpm.basic.excel.BasicRecordsExcel"> |
||||
SELECT * FROM logpm_basic_records ${ew.customSqlSegment} |
||||
</select> |
||||
|
||||
</mapper> |
@ -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<BasicRecordsEntity> { |
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param basicRecords |
||||
* @return |
||||
*/ |
||||
IPage<BasicRecordsVO> selectBasicRecordsPage(IPage<BasicRecordsVO> page, BasicRecordsVO basicRecords); |
||||
|
||||
|
||||
/** |
||||
* 导出数据 |
||||
* |
||||
* @param queryWrapper |
||||
* @return |
||||
*/ |
||||
List<BasicRecordsExcel> exportBasicRecords(Wrapper<BasicRecordsEntity> queryWrapper); |
||||
|
||||
} |
@ -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<BasicRecordsMapper, BasicRecordsEntity> implements IBasicRecordsService { |
||||
|
||||
@Override |
||||
public IPage<BasicRecordsVO> selectBasicRecordsPage(IPage<BasicRecordsVO> page, BasicRecordsVO basicRecords) { |
||||
return page.setRecords(baseMapper.selectBasicRecordsPage(page, basicRecords)); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public List<BasicRecordsExcel> exportBasicRecords(Wrapper<BasicRecordsEntity> queryWrapper) { |
||||
List<BasicRecordsExcel> basicRecordsList = baseMapper.exportBasicRecords(queryWrapper); |
||||
//basicRecordsList.forEach(basicRecords -> {
|
||||
// basicRecords.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicRecords.getType()));
|
||||
//});
|
||||
return basicRecordsList; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue