parent
3a1d91c1c5
commit
8bbf1128b4
8 changed files with 383 additions and 0 deletions
@ -0,0 +1,126 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* 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 |
||||
* <p> |
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* <p> |
||||
* 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.leger.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 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 org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.leger.entity.ToolInventoryRecord; |
||||
import org.energy.modules.leger.vo.ToolInventoryRecordVO; |
||||
import org.energy.modules.leger.service.IToolInventoryRecordService; |
||||
import com.dayu.daf.core.boot.ctrl.DafController; |
||||
|
||||
/** |
||||
* 工器具编码一览 控制器 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/toolinventoryrecord") |
||||
@Api(value = "工器具编码一览", tags = "工器具编码一览接口") |
||||
public class ToolInventoryRecordController extends DafController { |
||||
|
||||
private IToolInventoryRecordService toolInventoryRecordService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入toolInventoryRecord") |
||||
public R<ToolInventoryRecord> detail(ToolInventoryRecord toolInventoryRecord) { |
||||
ToolInventoryRecord detail = toolInventoryRecordService.getOne(Condition.getQueryWrapper(toolInventoryRecord)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 工器具编码一览 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入toolInventoryRecord") |
||||
public R<IPage<ToolInventoryRecord>> list(ToolInventoryRecord toolInventoryRecord, Query query) { |
||||
IPage<ToolInventoryRecord> pages = toolInventoryRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(toolInventoryRecord)); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 自定义分页 工器具编码一览 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入toolInventoryRecord") |
||||
public R<IPage<ToolInventoryRecordVO>> page(ToolInventoryRecordVO toolInventoryRecord, Query query) { |
||||
IPage<ToolInventoryRecordVO> pages = toolInventoryRecordService.selectToolInventoryRecordPage(Condition.getPage(query), toolInventoryRecord); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 工器具编码一览 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入toolInventoryRecord") |
||||
public R save(@Valid @RequestBody ToolInventoryRecord toolInventoryRecord) { |
||||
return R.status(toolInventoryRecordService.save(toolInventoryRecord)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 工器具编码一览 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入toolInventoryRecord") |
||||
public R update(@Valid @RequestBody ToolInventoryRecord toolInventoryRecord) { |
||||
return R.status(toolInventoryRecordService.updateById(toolInventoryRecord)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 工器具编码一览 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入toolInventoryRecord") |
||||
public R submit(@Valid @RequestBody ToolInventoryRecord toolInventoryRecord) { |
||||
return R.status(toolInventoryRecordService.saveOrUpdate(toolInventoryRecord)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除 工器具编码一览 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(toolInventoryRecordService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package org.energy.modules.leger.dto; |
||||
|
||||
import org.energy.modules.leger.entity.ToolInventoryRecord; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 工器具编码一览数据传输对象实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class ToolInventoryRecordDTO extends ToolInventoryRecord { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,107 @@ |
||||
package org.energy.modules.leger.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.dayu.daf.core.mp.base.BaseEntity; |
||||
import java.io.Serializable; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* 工器具编码一览实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@Data |
||||
@TableName("l_tool_inventory_record") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "ToolInventoryRecord对象", description = "工器具编码一览") |
||||
public class ToolInventoryRecord extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@ApiModelProperty(value = "主键") |
||||
private Long id; |
||||
/** |
||||
* 工器具编码 |
||||
*/ |
||||
@ApiModelProperty(value = "工器具编码") |
||||
private String toolCode; |
||||
/** |
||||
* 工器具名称 |
||||
*/ |
||||
@ApiModelProperty(value = "工器具名称") |
||||
private String toolName; |
||||
/** |
||||
* 规格型号 |
||||
*/ |
||||
@ApiModelProperty(value = "规格型号") |
||||
private String modelSpecification; |
||||
/** |
||||
* 配置日期 |
||||
*/ |
||||
@ApiModelProperty(value = "配置日期") |
||||
private String configurationDate; |
||||
/** |
||||
* 责任班组 |
||||
*/ |
||||
@ApiModelProperty(value = "责任班组") |
||||
private String responsibleTeam; |
||||
/** |
||||
* 场站 |
||||
*/ |
||||
@ApiModelProperty(value = "场站") |
||||
private String stations; |
||||
/** |
||||
* 工器具类别 |
||||
*/ |
||||
@ApiModelProperty(value = "工器具类别") |
||||
private String toolCategory; |
||||
/** |
||||
* 工器具状态 |
||||
*/ |
||||
@ApiModelProperty(value = "工器具状态") |
||||
private String toolStatus; |
||||
/** |
||||
* 已用年限 |
||||
*/ |
||||
@ApiModelProperty(value = "已用年限") |
||||
private String yearsInUsed; |
||||
/** |
||||
* 责任人 |
||||
*/ |
||||
@ApiModelProperty(value = "责任人") |
||||
private String responsiblPerson; |
||||
/** |
||||
* 工器具类别描述 |
||||
*/ |
||||
@ApiModelProperty(value = "工器具类别描述") |
||||
private String toolTypeDescription; |
||||
/** |
||||
* 工器具状态描述 |
||||
*/ |
||||
@ApiModelProperty(value = "工器具状态描述") |
||||
private String toolStatusDescription; |
||||
/** |
||||
* 出厂编号 |
||||
*/ |
||||
@ApiModelProperty(value = "出厂编号") |
||||
private String factoryNo; |
||||
/** |
||||
* 是否检验周期内 |
||||
*/ |
||||
@ApiModelProperty(value = "是否检验周期内") |
||||
private String isInspectionPeriod; |
||||
/** |
||||
* 审核状态 |
||||
*/ |
||||
@ApiModelProperty(value = "审核状态") |
||||
private Integer checkStatus; |
||||
|
||||
|
||||
} |
@ -0,0 +1,26 @@ |
||||
package org.energy.modules.leger.mapper; |
||||
|
||||
import org.energy.modules.leger.entity.ToolInventoryRecord; |
||||
import org.energy.modules.leger.vo.ToolInventoryRecordVO; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 工器具编码一览 Mapper 接口 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
public interface ToolInventoryRecordMapper extends BaseMapper<ToolInventoryRecord> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param toolInventoryRecord |
||||
* @return |
||||
*/ |
||||
List<ToolInventoryRecordVO> selectToolInventoryRecordPage(IPage page, ToolInventoryRecordVO toolInventoryRecord); |
||||
|
||||
} |
@ -0,0 +1,36 @@ |
||||
<?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="org.energy.modules.leger.mapper.ToolInventoryRecordMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="toolInventoryRecordResultMap" type="org.energy.modules.leger.entity.ToolInventoryRecord"> |
||||
<id column="id" property="id"/> |
||||
<result column="status" property="status"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="tool_code" property="toolCode"/> |
||||
<result column="tool_name" property="toolName"/> |
||||
<result column="model_specification" property="modelSpecification"/> |
||||
<result column="configuration_date" property="configurationDate"/> |
||||
<result column="responsible_team" property="responsibleTeam"/> |
||||
<result column="stations" property="stations"/> |
||||
<result column="tool_category" property="toolCategory"/> |
||||
<result column="tool_status" property="toolStatus"/> |
||||
<result column="years_in_used" property="yearsInUsed"/> |
||||
<result column="responsibl_person" property="responsiblPerson"/> |
||||
<result column="tool_type_description" property="toolTypeDescription"/> |
||||
<result column="tool_status_description" property="toolStatusDescription"/> |
||||
<result column="factory_no" property="factoryNo"/> |
||||
<result column="is_inspection_period" property="isInspectionPeriod"/> |
||||
<result column="check_status" property="checkStatus"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectToolInventoryRecordPage" resultMap="toolInventoryRecordResultMap"> |
||||
select * from l_tool_inventory_record where is_deleted = 0 |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,25 @@ |
||||
package org.energy.modules.leger.service; |
||||
|
||||
import org.energy.modules.leger.entity.ToolInventoryRecord; |
||||
import org.energy.modules.leger.vo.ToolInventoryRecordVO; |
||||
import com.dayu.daf.core.mp.base.BaseService; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
/** |
||||
* 工器具编码一览 服务类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
public interface IToolInventoryRecordService extends BaseService<ToolInventoryRecord> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param toolInventoryRecord |
||||
* @return |
||||
*/ |
||||
IPage<ToolInventoryRecordVO> selectToolInventoryRecordPage(IPage<ToolInventoryRecordVO> page, ToolInventoryRecordVO toolInventoryRecord); |
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
package org.energy.modules.leger.service.impl; |
||||
|
||||
import org.energy.modules.leger.entity.ToolInventoryRecord; |
||||
import org.energy.modules.leger.vo.ToolInventoryRecordVO; |
||||
import org.energy.modules.leger.mapper.ToolInventoryRecordMapper; |
||||
import org.energy.modules.leger.service.IToolInventoryRecordService; |
||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
/** |
||||
* 工器具编码一览 服务实现类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@Service |
||||
public class ToolInventoryRecordServiceImpl extends BaseServiceImpl<ToolInventoryRecordMapper, ToolInventoryRecord> implements IToolInventoryRecordService { |
||||
|
||||
@Override |
||||
public IPage<ToolInventoryRecordVO> selectToolInventoryRecordPage(IPage<ToolInventoryRecordVO> page, ToolInventoryRecordVO toolInventoryRecord) { |
||||
return page.setRecords(baseMapper.selectToolInventoryRecordPage(page, toolInventoryRecord)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.energy.modules.leger.vo; |
||||
|
||||
import org.energy.modules.leger.entity.ToolInventoryRecord; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
|
||||
/** |
||||
* 工器具编码一览视图实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "ToolInventoryRecordVO对象", description = "工器具编码一览") |
||||
public class ToolInventoryRecordVO extends ToolInventoryRecord { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
Loading…
Reference in new issue