parent
942ac15dbf
commit
dcf7a6df92
8 changed files with 0 additions and 344 deletions
@ -1,139 +0,0 @@ |
|||||||
/** |
|
||||||
* 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.spares.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.spares.entity.MaterialClassCode; |
|
||||||
import org.energy.modules.spares.vo.MaterialClassCodeVO; |
|
||||||
import org.energy.modules.spares.service.IMaterialClassCodeService; |
|
||||||
import com.dayu.daf.core.boot.ctrl.DafController; |
|
||||||
|
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* 物资分类码 控制器 |
|
||||||
* |
|
||||||
* @author Daf |
|
||||||
* @since 2024-07-15 |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
@AllArgsConstructor |
|
||||||
@RequestMapping("/spares/materialclasscode") |
|
||||||
@Api(value = "物资分类码", tags = "物资分类码接口") |
|
||||||
public class MaterialClassCodeController extends DafController { |
|
||||||
|
|
||||||
private IMaterialClassCodeService materialClassCodeService; |
|
||||||
|
|
||||||
/** |
|
||||||
* 详情 |
|
||||||
*/ |
|
||||||
@GetMapping("/detail") |
|
||||||
@ApiOperationSupport(order = 1) |
|
||||||
@ApiOperation(value = "详情", notes = "传入materialClassCode") |
|
||||||
public R<MaterialClassCode> detail(MaterialClassCode materialClassCode) { |
|
||||||
MaterialClassCode detail = materialClassCodeService.getOne(Condition.getQueryWrapper(materialClassCode)); |
|
||||||
return R.data(detail); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 分页 物资分类码 |
|
||||||
*/ |
|
||||||
@GetMapping("/list") |
|
||||||
@ApiOperationSupport(order = 2) |
|
||||||
@ApiOperation(value = "分页", notes = "传入materialClassCode") |
|
||||||
public R<IPage<MaterialClassCode>> list(MaterialClassCode materialClassCode, Query query) { |
|
||||||
IPage<MaterialClassCode> pages = materialClassCodeService.page(Condition.getPage(query), Condition.getQueryWrapper(materialClassCode)); |
|
||||||
return R.data(pages); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 自定义分页 物资分类码 |
|
||||||
*/ |
|
||||||
@GetMapping("/page") |
|
||||||
@ApiOperationSupport(order = 3) |
|
||||||
@ApiOperation(value = "分页", notes = "传入materialClassCode") |
|
||||||
public R<IPage<MaterialClassCodeVO>> page(MaterialClassCodeVO materialClassCode, Query query) { |
|
||||||
IPage<MaterialClassCodeVO> pages = materialClassCodeService.selectMaterialClassCodePage(Condition.getPage(query), materialClassCode); |
|
||||||
return R.data(pages); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 新增 物资分类码 |
|
||||||
*/ |
|
||||||
@PostMapping("/save") |
|
||||||
@ApiOperationSupport(order = 4) |
|
||||||
@ApiOperation(value = "新增", notes = "传入materialClassCode") |
|
||||||
public R save(@Valid @RequestBody MaterialClassCode materialClassCode) { |
|
||||||
return R.status(materialClassCodeService.save(materialClassCode)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 修改 物资分类码 |
|
||||||
*/ |
|
||||||
@PostMapping("/update") |
|
||||||
@ApiOperationSupport(order = 5) |
|
||||||
@ApiOperation(value = "修改", notes = "传入materialClassCode") |
|
||||||
public R update(@Valid @RequestBody MaterialClassCode materialClassCode) { |
|
||||||
return R.status(materialClassCodeService.updateById(materialClassCode)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 新增或修改 物资分类码 |
|
||||||
*/ |
|
||||||
@PostMapping("/submit") |
|
||||||
@ApiOperationSupport(order = 6) |
|
||||||
@ApiOperation(value = "新增或修改", notes = "传入materialClassCode") |
|
||||||
public R submit(@Valid @RequestBody MaterialClassCode materialClassCode) { |
|
||||||
return R.status(materialClassCodeService.saveOrUpdate(materialClassCode)); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
/** |
|
||||||
* 删除 物资分类码 |
|
||||||
*/ |
|
||||||
@PostMapping("/remove") |
|
||||||
@ApiOperationSupport(order = 7) |
|
||||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
|
||||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
|
||||||
return R.status(materialClassCodeService.deleteLogic(Func.toLongList(ids))); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 分页 物资分类码 |
|
||||||
*/ |
|
||||||
@GetMapping("/getMaterialClassCodeList") |
|
||||||
@ApiOperationSupport(order = 2) |
|
||||||
@ApiOperation(value = "获取物资分类码", notes = "获取物资分类码") |
|
||||||
public R<List<String>> getMaterialClassCodeList() { |
|
||||||
List<String> list = materialClassCodeService.getMaterialClassCodeList(); |
|
||||||
return R.data(list); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,18 +0,0 @@ |
|||||||
package org.energy.modules.spares.dto; |
|
||||||
|
|
||||||
import org.energy.modules.spares.entity.MaterialClassCode; |
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
|
|
||||||
/** |
|
||||||
* 物资分类码数据传输对象实体类 |
|
||||||
* |
|
||||||
* @author Daf |
|
||||||
* @since 2024-07-15 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
public class MaterialClassCodeDTO extends MaterialClassCode { |
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
} |
|
@ -1,42 +0,0 @@ |
|||||||
package org.energy.modules.spares.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-15 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@TableName("s_material_class_code") |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
@ApiModel(value = "MaterialClassCode对象", description = "物资分类码") |
|
||||||
public class MaterialClassCode extends BaseEntity { |
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
/** |
|
||||||
* 分类码编号 |
|
||||||
*/ |
|
||||||
@ApiModelProperty(value = "分类码编号") |
|
||||||
private Long id; |
|
||||||
/** |
|
||||||
* 物资类型 |
|
||||||
*/ |
|
||||||
@ApiModelProperty(value = "物资类型") |
|
||||||
private String materialType; |
|
||||||
/** |
|
||||||
* 物资分类码 |
|
||||||
*/ |
|
||||||
@ApiModelProperty(value = "物资分类码") |
|
||||||
private String materialClassCode; |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,31 +0,0 @@ |
|||||||
package org.energy.modules.spares.mapper; |
|
||||||
|
|
||||||
import org.energy.modules.spares.entity.MaterialClassCode; |
|
||||||
import org.energy.modules.spares.vo.MaterialClassCodeVO; |
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* 物资分类码 Mapper 接口 |
|
||||||
* |
|
||||||
* @author Daf |
|
||||||
* @since 2024-07-15 |
|
||||||
*/ |
|
||||||
public interface MaterialClassCodeMapper extends BaseMapper<MaterialClassCode> { |
|
||||||
|
|
||||||
/** |
|
||||||
* 自定义分页 |
|
||||||
* |
|
||||||
* @param page |
|
||||||
* @param materialClassCode |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
List<MaterialClassCodeVO> selectMaterialClassCodePage(IPage page, MaterialClassCodeVO materialClassCode); |
|
||||||
|
|
||||||
/** |
|
||||||
* 获取物资分类码 |
|
||||||
*/ |
|
||||||
List<String> getMaterialClassCodeList(); |
|
||||||
|
|
||||||
} |
|
@ -1,27 +0,0 @@ |
|||||||
<?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.spares.mapper.MaterialClassCodeMapper"> |
|
||||||
|
|
||||||
<!-- 通用查询映射结果 --> |
|
||||||
<resultMap id="materialClassCodeResultMap" type="org.energy.modules.spares.entity.MaterialClassCode"> |
|
||||||
<id column="id" property="id"/> |
|
||||||
<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="status" property="status"/> |
|
||||||
<result column="material_type" property="materialType"/> |
|
||||||
<result column="material_class_code" property="materialClassCode"/> |
|
||||||
</resultMap> |
|
||||||
|
|
||||||
|
|
||||||
<select id="selectMaterialClassCodePage" resultMap="materialClassCodeResultMap"> |
|
||||||
select * from s_material_class_code where is_deleted = 0 |
|
||||||
</select> |
|
||||||
|
|
||||||
<select id="getMaterialClassCodeList" resultType="java.lang.String"> |
|
||||||
select material_class_code from s_material_class_code where is_deleted = 0 |
|
||||||
</select> |
|
||||||
|
|
||||||
</mapper> |
|
@ -1,32 +0,0 @@ |
|||||||
package org.energy.modules.spares.service; |
|
||||||
|
|
||||||
import org.energy.modules.spares.entity.MaterialClassCode; |
|
||||||
import org.energy.modules.spares.vo.MaterialClassCodeVO; |
|
||||||
import com.dayu.daf.core.mp.base.BaseService; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
|
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* 物资分类码 服务类 |
|
||||||
* |
|
||||||
* @author Daf |
|
||||||
* @since 2024-07-15 |
|
||||||
*/ |
|
||||||
public interface IMaterialClassCodeService extends BaseService<MaterialClassCode> { |
|
||||||
|
|
||||||
/** |
|
||||||
* 自定义分页 |
|
||||||
* |
|
||||||
* @param page |
|
||||||
* @param materialClassCode |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
IPage<MaterialClassCodeVO> selectMaterialClassCodePage(IPage<MaterialClassCodeVO> page, MaterialClassCodeVO materialClassCode); |
|
||||||
|
|
||||||
/** |
|
||||||
* 获取物资分类码 |
|
||||||
*/ |
|
||||||
List<String> getMaterialClassCodeList(); |
|
||||||
|
|
||||||
} |
|
@ -1,35 +0,0 @@ |
|||||||
package org.energy.modules.spares.service.impl; |
|
||||||
|
|
||||||
import org.energy.modules.spares.entity.MaterialClassCode; |
|
||||||
import org.energy.modules.spares.vo.MaterialClassCodeVO; |
|
||||||
import org.energy.modules.spares.mapper.MaterialClassCodeMapper; |
|
||||||
import org.energy.modules.spares.service.IMaterialClassCodeService; |
|
||||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
|
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* 物资分类码 服务实现类 |
|
||||||
* |
|
||||||
* @author Daf |
|
||||||
* @since 2024-07-15 |
|
||||||
*/ |
|
||||||
@Service |
|
||||||
public class MaterialClassCodeServiceImpl extends BaseServiceImpl<MaterialClassCodeMapper, MaterialClassCode> implements IMaterialClassCodeService { |
|
||||||
|
|
||||||
@Override |
|
||||||
public IPage<MaterialClassCodeVO> selectMaterialClassCodePage(IPage<MaterialClassCodeVO> page, MaterialClassCodeVO materialClassCode) { |
|
||||||
return page.setRecords(baseMapper.selectMaterialClassCodePage(page, materialClassCode)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 获取物资分类码 |
|
||||||
*/ |
|
||||||
@Override |
|
||||||
public List<String> getMaterialClassCodeList() { |
|
||||||
return baseMapper.getMaterialClassCodeList(); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,20 +0,0 @@ |
|||||||
package org.energy.modules.spares.vo; |
|
||||||
|
|
||||||
import org.energy.modules.spares.entity.MaterialClassCode; |
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import io.swagger.annotations.ApiModel; |
|
||||||
|
|
||||||
/** |
|
||||||
* 物资分类码视图实体类 |
|
||||||
* |
|
||||||
* @author Daf |
|
||||||
* @since 2024-07-15 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
@ApiModel(value = "MaterialClassCodeVO对象", description = "物资分类码") |
|
||||||
public class MaterialClassCodeVO extends MaterialClassCode { |
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
} |
|
Loading…
Reference in new issue