From 38ad1741756db5ffba3ce97e5e128008530f9137 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Mon, 14 Oct 2024 15:03:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86--=E9=80=BB=E8=BE=91=E5=88=A0=E9=99=A4=E3=80=81?= =?UTF-8?q?=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ma/controller/TypeController.java | 64 ++++++++----------- .../com/bonus/material/ma/domain/Type.java | 14 ++-- .../bonus/material/ma/mapper/TypeMapper.java | 57 +++++++++-------- .../material/ma/service/ITypeService.java | 49 +++++++------- .../ma/service/impl/TypeServiceImpl.java | 55 ++++++++-------- .../mapper/material/ma/TypeMapper.xml | 21 +++--- 6 files changed, 128 insertions(+), 132 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java index d0531686..f6c4456e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java @@ -25,94 +25,86 @@ import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.page.TableDataInfo; /** - * 机具类型管理Controller - * - * @author xsheng - * @date 2024-09-27 + * 物资类型管理Controller + * @author syruan */ -@Api(tags = "机具类型管理接口") +@Api(tags = "物资类型管理接口") @RestController @RequestMapping("/ma_type") -public class TypeController extends BaseController -{ +public class TypeController extends BaseController { + @Autowired private ITypeService typeService; /** - * 查询机具类型管理列表 + * 查询物资类型管理列表 */ - @ApiOperation(value = "查询机具类型管理列表") + @ApiOperation(value = "查询物资类型管理列表") @RequiresPermissions("ma:type:list") @GetMapping("/list") - public TableDataInfo list(Type type) - { + public TableDataInfo list(Type type) { startPage(); List list = typeService.selectTypeList(type); return getDataTable(list); } /** - * 导出机具类型管理列表 + * 导出物资类型管理列表 */ - @ApiOperation(value = "导出机具类型管理列表") + @ApiOperation(value = "导出物资类型管理列表") @PreventRepeatSubmit @RequiresPermissions("ma:type:export") - @SysLog(title = "机具类型管理", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出机具类型管理") + @SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型") @PostMapping("/export") - public void export(HttpServletResponse response, Type type) - { + public void export(HttpServletResponse response, Type type) { List list = typeService.selectTypeList(type); ExcelUtil util = new ExcelUtil(Type.class); - util.exportExcel(response, list, "机具类型管理数据"); + util.exportExcel(response, list, "物资类型管理数据"); } /** - * 获取机具类型管理详细信息 + * 获取物资类型管理详细信息 */ - @ApiOperation(value = "获取机具类型管理详细信息") + @ApiOperation(value = "获取物资类型管理详细信息") @RequiresPermissions("ma:type:query") @GetMapping(value = "/{typeId}") - public AjaxResult getInfo(@PathVariable("typeId") Long typeId) - { + public AjaxResult getInfo(@PathVariable("typeId") Long typeId) { return success(typeService.selectTypeByTypeId(typeId)); } /** - * 新增机具类型管理 + * 新增物资类型管理 */ - @ApiOperation(value = "新增机具类型管理") + @ApiOperation(value = "新增物资类型管理") @PreventRepeatSubmit @RequiresPermissions("ma:type:add") - @SysLog(title = "机具类型管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增机具类型管理") + @SysLog(title = "物资类型管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增物资类型") @PostMapping - public AjaxResult add(@RequestBody Type type) - { + public AjaxResult add(@RequestBody Type type) { return toAjax(typeService.insertType(type)); } /** - * 修改机具类型管理 + * 修改物资类型管理 */ - @ApiOperation(value = "修改机具类型管理") + @ApiOperation(value = "修改物资类型管理") @PreventRepeatSubmit @RequiresPermissions("ma:type:edit") - @SysLog(title = "机具类型管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改机具类型管理") + @SysLog(title = "物资类型管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改物资类型") @PutMapping - public AjaxResult edit(@RequestBody Type type) - { + public AjaxResult edit(@RequestBody Type type) { return toAjax(typeService.updateType(type)); } /** - * 删除机具类型管理 + * 删除物资类型管理 */ - @ApiOperation(value = "删除机具类型管理") + @ApiOperation(value = "删除物资类型管理") @PreventRepeatSubmit @RequiresPermissions("ma:type:remove") - @SysLog(title = "机具类型管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除机具类型管理") + @SysLog(title = "物资类型管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除物资类型") @DeleteMapping("/{typeIds}") - public AjaxResult remove(@PathVariable Long[] typeIds) - { + public AjaxResult remove(@PathVariable Long[] typeIds) { return toAjax(typeService.deleteTypeByTypeIds(typeIds)); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java index 9a9c07ce..12275cbb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java @@ -6,21 +6,19 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.bonus.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.ToString; import com.bonus.common.core.web.domain.BaseEntity; /** - * 机具类型管理对象 ma_type - * - * @author xsheng - * @date 2024-09-27 + * 物资类型对象 ma_type + * @author syruan */ - - +@EqualsAndHashCode(callSuper = false) @Data @ToString -public class Type extends BaseEntity -{ +public class Type extends BaseEntity { + private static final long serialVersionUID = 1L; /** 类型ID */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java index 68b10f46..fe0f2947 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java @@ -2,60 +2,67 @@ package com.bonus.material.ma.mapper; import java.util.List; import com.bonus.material.ma.domain.Type; +import org.apache.ibatis.annotations.Mapper; /** - * 机具类型管理Mapper接口 - * - * @author xsheng - * @date 2024-09-27 + * 物资类型Mapper接口 + * @author syruan */ -public interface TypeMapper -{ +@Mapper +public interface TypeMapper { /** - * 查询机具类型管理 + * 查询物资类型 * - * @param typeId 机具类型管理主键 - * @return 机具类型管理 + * @param typeId 物资类型主键 + * @return 物资类型 */ - public Type selectTypeByTypeId(Long typeId); + Type selectTypeByTypeId(Long typeId); /** - * 查询机具类型管理列表 + * 查询物资类型列表 * - * @param type 机具类型管理 - * @return 机具类型管理集合 + * @param type 物资类型 + * @return 物资类型集合 */ - public List selectTypeList(Type type); + List selectTypeList(Type type); /** - * 新增机具类型管理 + * 新增物资类型 * - * @param type 机具类型管理 + * @param type 物资类型 * @return 结果 */ - public int insertType(Type type); + int insertType(Type type); /** - * 修改机具类型管理 + * 修改物资类型 * - * @param type 机具类型管理 + * @param type 物资类型 * @return 结果 */ - public int updateType(Type type); + int updateType(Type type); /** - * 删除机具类型管理 + * 删除物资类型 -- 真实删除 * - * @param typeId 机具类型管理主键 + * @param typeId 物资类型主键 * @return 结果 */ - public int deleteTypeByTypeId(Long typeId); + int deleteTypeByTypeId(Long typeId); /** - * 批量删除机具类型管理 + * 删除物资类型 -- 逻辑删除 + * + * @param typeId 物资类型主键 + * @return 结果 + */ + int logicDeleteTypeByTypeId(Long typeId); + + /** + * 批量删除物资类型 -- 逻辑删除 * * @param typeIds 需要删除的数据主键集合 * @return 结果 */ - public int deleteTypeByTypeIds(Long[] typeIds); + int logicDeleteTypeByTypeIds(Long[] typeIds); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java index 3420fdf5..1b48be9e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java @@ -4,58 +4,55 @@ import java.util.List; import com.bonus.material.ma.domain.Type; /** - * 机具类型管理Service接口 - * - * @author xsheng - * @date 2024-09-27 + * 物资类型Service接口 + * @author syruan */ -public interface ITypeService -{ +public interface ITypeService { /** - * 查询机具类型管理 + * 查询物资类型 * - * @param typeId 机具类型管理主键 - * @return 机具类型管理 + * @param typeId 物资类型主键 + * @return 物资类型 */ - public Type selectTypeByTypeId(Long typeId); + Type selectTypeByTypeId(Long typeId); /** - * 查询机具类型管理列表 + * 查询物资类型列表 * - * @param type 机具类型管理 - * @return 机具类型管理集合 + * @param type 物资类型 + * @return 物资类型集合 */ - public List selectTypeList(Type type); + List selectTypeList(Type type); /** - * 新增机具类型管理 + * 新增物资类型 * - * @param type 机具类型管理 + * @param type 物资类型 * @return 结果 */ - public int insertType(Type type); + int insertType(Type type); /** - * 修改机具类型管理 + * 修改物资类型 * - * @param type 机具类型管理 + * @param type 物资类型 * @return 结果 */ - public int updateType(Type type); + int updateType(Type type); /** - * 批量删除机具类型管理 + * 批量删除物资类型 * - * @param typeIds 需要删除的机具类型管理主键集合 + * @param typeIds 需要删除的物资类型主键集合 * @return 结果 */ - public int deleteTypeByTypeIds(Long[] typeIds); + int deleteTypeByTypeIds(Long[] typeIds); /** - * 删除机具类型管理信息 + * 删除物资类型信息 * - * @param typeId 机具类型管理主键 + * @param typeId 物资类型主键 * @return 结果 */ - public int deleteTypeByTypeId(Long typeId); + int deleteTypeByTypeId(Long typeId); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index 7dc5cb9f..67b37bf6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -8,35 +8,34 @@ import com.bonus.material.ma.mapper.TypeMapper; import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.service.ITypeService; +import javax.annotation.Resource; + /** - * 机具类型管理Service业务层处理 - * - * @author xsheng - * @date 2024-09-27 + * 物资类型管理Service业务层实现 + * @author syruan */ @Service -public class TypeServiceImpl implements ITypeService -{ - @Autowired +public class TypeServiceImpl implements ITypeService { + + @Resource private TypeMapper typeMapper; /** - * 查询机具类型管理 + * 查询物资类型管理 * - * @param typeId 机具类型管理主键 - * @return 机具类型管理 + * @param typeId 物资类型管理主键 + * @return 物资类型管理 */ @Override - public Type selectTypeByTypeId(Long typeId) - { + public Type selectTypeByTypeId(Long typeId) { return typeMapper.selectTypeByTypeId(typeId); } /** - * 查询机具类型管理列表 + * 查询物资类型管理列表 * - * @param type 机具类型管理 - * @return 机具类型管理 + * @param type 物资类型管理 + * @return 物资类型管理 */ @Override public List selectTypeList(Type type) @@ -45,22 +44,21 @@ public class TypeServiceImpl implements ITypeService } /** - * 新增机具类型管理 + * 新增物资类型管理 * - * @param type 机具类型管理 + * @param type 物资类型管理 * @return 结果 */ @Override - public int insertType(Type type) - { + public int insertType(Type type) { type.setCreateTime(DateUtils.getNowDate()); return typeMapper.insertType(type); } /** - * 修改机具类型管理 + * 修改物资类型管理 * - * @param type 机具类型管理 + * @param type 物资类型管理 * @return 结果 */ @Override @@ -71,26 +69,25 @@ public class TypeServiceImpl implements ITypeService } /** - * 批量删除机具类型管理 + * 批量删除物资类型管理 * - * @param typeIds 需要删除的机具类型管理主键 + * @param typeIds 需要删除的物资类型管理主键 * @return 结果 */ @Override public int deleteTypeByTypeIds(Long[] typeIds) { - return typeMapper.deleteTypeByTypeIds(typeIds); + return typeMapper.logicDeleteTypeByTypeIds(typeIds); } /** - * 删除机具类型管理信息 + * 删除物资类型 * - * @param typeId 机具类型管理主键 + * @param typeId 物资类型管理主键 * @return 结果 */ @Override - public int deleteTypeByTypeId(Long typeId) - { - return typeMapper.deleteTypeByTypeId(typeId); + public int deleteTypeByTypeId(Long typeId) { + return typeMapper.logicDeleteTypeByTypeId(typeId); } } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml index 8d0ee58c..1eb51fec 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml @@ -3,6 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + @@ -35,7 +36,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select type_id, type_name, parent_id, storage_num, type_code, model_code, unit_id, manage_type, lease_price, eff_time, rent_price, buy_price, pay_ratio, level, rated_load, test_load, holding_time, warn_num, del_flag, create_by, create_time, update_by, update_time, is_plan, is_ancuo, remark, fac_model, intelligent_code from ma_type + select + type_id, type_name, parent_id, storage_num, type_code, model_code, unit_id, manage_type, lease_price, + eff_time, rent_price, buy_price, pay_ratio, level, rated_load, test_load, holding_time, warn_num, + create_by, create_time, update_by, update_time, is_plan,is_ancuo, remark, fac_model, intelligent_code + from ma_type @@ -90,7 +96,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" test_load, holding_time, warn_num, - del_flag, create_by, create_time, update_by, @@ -119,7 +124,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{testLoad}, #{holdingTime}, #{warnNum}, - #{delFlag}, #{createBy}, #{createTime}, #{updateBy}, @@ -152,9 +156,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" test_load = #{testLoad}, holding_time = #{holdingTime}, warn_num = #{warnNum}, - del_flag = #{delFlag}, - create_by = #{createBy}, - create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, is_plan = #{isPlan}, @@ -170,10 +171,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from ma_type where type_id = #{typeId} - - delete from ma_type where type_id in + + update ma_type set del_flag = 2 where type_id in #{typeId} + + + update ma_type set del_flag = 2 where type_id = #{typeId,jdbcType=BIGINT} + \ No newline at end of file