From 6cdf19cca3c0c95a990ec0c2ae4eb9776b1720da Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Tue, 15 Oct 2024 18:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E5=8E=82=E5=AE=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ma/controller/SupplierInfoController.java | 69 +++++++++---------- .../material/ma/domain/SupplierInfo.java | 14 ++-- .../ma/mapper/SupplierInfoMapper.java | 43 ++++++------ .../ma/service/ISupplierInfoService.java | 48 +++++++------ .../service/impl/SupplierInfoServiceImpl.java | 46 ++++++------- .../resources/bootstrap-sgzb_bns_local.yml | 2 - .../mapper/material/ma/SupplierInfoMapper.xml | 12 +--- 7 files changed, 107 insertions(+), 127 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java index 61cd22f3..ea8163fe 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java @@ -1,6 +1,7 @@ package com.bonus.material.ma.controller; import java.util.List; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import com.bonus.common.log.enums.OperaType; import com.bonus.material.common.annotation.PreventRepeatSubmit; @@ -25,94 +26,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 bonus */ -@Api(tags = "供应商管理接口") +@Api(tags = "物资厂家管理接口") @RestController @RequestMapping("/ma_supplier_info") -public class SupplierInfoController extends BaseController -{ - @Autowired +public class SupplierInfoController extends BaseController { + + @Resource private ISupplierInfoService supplierInfoService; /** - * 查询供应商管理列表 + * 查询物资厂家管理列表 */ - @ApiOperation(value = "查询供应商管理列表") + @ApiOperation(value = "查询物资厂家管理列表") @RequiresPermissions("ma:info:list") @GetMapping("/list") - public TableDataInfo list(SupplierInfo supplierInfo) - { + public TableDataInfo list(SupplierInfo supplierInfo) { startPage(); List list = supplierInfoService.selectSupplierInfoList(supplierInfo); return getDataTable(list); } /** - * 导出供应商管理列表 + * 导出物资厂家管理列表 */ - @ApiOperation(value = "导出供应商管理列表") + @ApiOperation(value = "导出物资厂家管理列表") @PreventRepeatSubmit @RequiresPermissions("ma:info:export") - @SysLog(title = "供应商管理", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出供应商管理") + @SysLog(title = "物资厂家管理", businessType = OperaType.EXPORT, logType = 1,module = "物资管理->导出物资厂家管理") @PostMapping("/export") - public void export(HttpServletResponse response, SupplierInfo supplierInfo) - { + public void export(HttpServletResponse response, SupplierInfo supplierInfo) { List list = supplierInfoService.selectSupplierInfoList(supplierInfo); - ExcelUtil util = new ExcelUtil(SupplierInfo.class); - util.exportExcel(response, list, "供应商管理数据"); + ExcelUtil util = new ExcelUtil<>(SupplierInfo.class); + util.exportExcel(response, list, "物资厂家管理数据"); } /** - * 获取供应商管理详细信息 + * 获取物资厂家管理详细信息 */ - @ApiOperation(value = "获取供应商管理详细信息") + @ApiOperation(value = "获取物资厂家管理详细信息") @RequiresPermissions("ma:info:query") @GetMapping(value = "/{supplierId}") - public AjaxResult getInfo(@PathVariable("supplierId") Long supplierId) - { + public AjaxResult getInfo(@PathVariable("supplierId") Long supplierId) { return success(supplierInfoService.selectSupplierInfoBySupplierId(supplierId)); } /** - * 新增供应商管理 + * 新增物资厂家管理 */ - @ApiOperation(value = "新增供应商管理") + @ApiOperation(value = "新增物资厂家管理") @PreventRepeatSubmit @RequiresPermissions("ma:info:add") - @SysLog(title = "供应商管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增供应商管理") + @SysLog(title = "物资厂家管理", businessType = OperaType.INSERT, module = "物资管理->新增物资厂家管理") @PostMapping - public AjaxResult add(@RequestBody SupplierInfo supplierInfo) - { + public AjaxResult add(@RequestBody SupplierInfo supplierInfo) { return toAjax(supplierInfoService.insertSupplierInfo(supplierInfo)); } /** - * 修改供应商管理 + * 修改物资厂家管理 */ - @ApiOperation(value = "修改供应商管理") + @ApiOperation(value = "修改物资厂家管理") @PreventRepeatSubmit @RequiresPermissions("ma:info:edit") - @SysLog(title = "供应商管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改供应商管理") + @SysLog(title = "物资厂家管理", businessType = OperaType.UPDATE, module = "物资管理->修改物资厂家管理") @PutMapping - public AjaxResult edit(@RequestBody SupplierInfo supplierInfo) - { + public AjaxResult edit(@RequestBody SupplierInfo supplierInfo) { return toAjax(supplierInfoService.updateSupplierInfo(supplierInfo)); } /** - * 删除供应商管理 + * 删除物资厂家管理 */ - @ApiOperation(value = "删除供应商管理") + @ApiOperation(value = "删除物资厂家管理") @PreventRepeatSubmit @RequiresPermissions("ma:info:remove") - @SysLog(title = "供应商管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除供应商管理") + @SysLog(title = "物资厂家管理", businessType = OperaType.DELETE, module = "物资管理->删除物资厂家管理") @DeleteMapping("/{supplierIds}") - public AjaxResult remove(@PathVariable Long[] supplierIds) - { + public AjaxResult remove(@PathVariable Long[] supplierIds) { return toAjax(supplierInfoService.deleteSupplierInfoBySupplierIds(supplierIds)); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/SupplierInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/SupplierInfo.java index 4c820e6e..bc736808 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/SupplierInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/SupplierInfo.java @@ -3,22 +3,22 @@ package com.bonus.material.ma.domain; 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_supplier_info - * - * @author xsheng - * @date 2024-09-27 + * 物资厂家管理对象 ma_supplier_info + * @author bonus */ +@EqualsAndHashCode(callSuper = false) @Data @ToString -public class SupplierInfo extends BaseEntity -{ - private static final long serialVersionUID = 1L; +public class SupplierInfo extends BaseEntity { + + private static final long serialVersionUID = 1720446126255482527L; /** 仓库ID */ private Long supplierId; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/SupplierInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/SupplierInfoMapper.java index 5c5b03e6..5aca4ef7 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/SupplierInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/SupplierInfoMapper.java @@ -4,58 +4,57 @@ import java.util.List; import com.bonus.material.ma.domain.SupplierInfo; /** - * 供应商管理Mapper接口 + * 物资厂家管理Mapper接口 * * @author xsheng * @date 2024-09-27 */ -public interface SupplierInfoMapper -{ +public interface SupplierInfoMapper { /** - * 查询供应商管理 + * 查询物资厂家管理 * - * @param supplierId 供应商管理主键 - * @return 供应商管理 + * @param supplierId 物资厂家管理主键 + * @return 物资厂家管理 */ - public SupplierInfo selectSupplierInfoBySupplierId(Long supplierId); + SupplierInfo selectSupplierInfoBySupplierId(Long supplierId); /** - * 查询供应商管理列表 + * 查询物资厂家管理列表 * - * @param supplierInfo 供应商管理 - * @return 供应商管理集合 + * @param supplierInfo 物资厂家管理 + * @return 物资厂家管理集合 */ - public List selectSupplierInfoList(SupplierInfo supplierInfo); + List selectSupplierInfoList(SupplierInfo supplierInfo); /** - * 新增供应商管理 + * 新增物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ - public int insertSupplierInfo(SupplierInfo supplierInfo); + int insertSupplierInfo(SupplierInfo supplierInfo); /** - * 修改供应商管理 + * 修改物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ - public int updateSupplierInfo(SupplierInfo supplierInfo); + int updateSupplierInfo(SupplierInfo supplierInfo); /** - * 删除供应商管理 + * 删除物资厂家管理 * - * @param supplierId 供应商管理主键 + * @param supplierId 物资厂家管理主键 * @return 结果 */ - public int deleteSupplierInfoBySupplierId(Long supplierId); + int deleteSupplierInfoBySupplierId(Long supplierId); /** - * 批量删除供应商管理 + * 批量删除物资厂家管理 * * @param supplierIds 需要删除的数据主键集合 * @return 结果 */ - public int deleteSupplierInfoBySupplierIds(Long[] supplierIds); + int deleteSupplierInfoBySupplierIds(Long[] supplierIds); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ISupplierInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ISupplierInfoService.java index a9ef72f6..3226fe8d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ISupplierInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ISupplierInfoService.java @@ -4,58 +4,56 @@ import java.util.List; import com.bonus.material.ma.domain.SupplierInfo; /** - * 供应商管理Service接口 + * 物资厂家管理Service接口 * - * @author xsheng - * @date 2024-09-27 + * @author bonus */ -public interface ISupplierInfoService -{ +public interface ISupplierInfoService { /** - * 查询供应商管理 + * 查询物资厂家管理 * - * @param supplierId 供应商管理主键 - * @return 供应商管理 + * @param supplierId 物资厂家管理主键 + * @return 物资厂家管理 */ - public SupplierInfo selectSupplierInfoBySupplierId(Long supplierId); + SupplierInfo selectSupplierInfoBySupplierId(Long supplierId); /** - * 查询供应商管理列表 + * 查询物资厂家管理列表 * - * @param supplierInfo 供应商管理 - * @return 供应商管理集合 + * @param supplierInfo 物资厂家管理 + * @return 物资厂家管理集合 */ - public List selectSupplierInfoList(SupplierInfo supplierInfo); + List selectSupplierInfoList(SupplierInfo supplierInfo); /** - * 新增供应商管理 + * 新增物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ - public int insertSupplierInfo(SupplierInfo supplierInfo); + int insertSupplierInfo(SupplierInfo supplierInfo); /** - * 修改供应商管理 + * 修改物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ - public int updateSupplierInfo(SupplierInfo supplierInfo); + int updateSupplierInfo(SupplierInfo supplierInfo); /** - * 批量删除供应商管理 + * 批量删除物资厂家管理 * - * @param supplierIds 需要删除的供应商管理主键集合 + * @param supplierIds 需要删除的物资厂家管理主键集合 * @return 结果 */ - public int deleteSupplierInfoBySupplierIds(Long[] supplierIds); + int deleteSupplierInfoBySupplierIds(Long[] supplierIds); /** - * 删除供应商管理信息 + * 删除物资厂家管理信息 * - * @param supplierId 供应商管理主键 + * @param supplierId 物资厂家管理主键 * @return 结果 */ - public int deleteSupplierInfoBySupplierId(Long supplierId); + int deleteSupplierInfoBySupplierId(Long supplierId); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java index 47bfc76b..ab18e9ec 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/SupplierInfoServiceImpl.java @@ -8,23 +8,24 @@ import com.bonus.material.ma.mapper.SupplierInfoMapper; import com.bonus.material.ma.domain.SupplierInfo; import com.bonus.material.ma.service.ISupplierInfoService; +import javax.annotation.Resource; + /** - * 供应商管理Service业务层处理 + * 物资厂家管理Service业务层处理 * * @author xsheng * @date 2024-09-27 */ @Service -public class SupplierInfoServiceImpl implements ISupplierInfoService -{ - @Autowired +public class SupplierInfoServiceImpl implements ISupplierInfoService { + @Resource private SupplierInfoMapper supplierInfoMapper; /** - * 查询供应商管理 + * 查询物资厂家管理 * - * @param supplierId 供应商管理主键 - * @return 供应商管理 + * @param supplierId 物资厂家管理主键 + * @return 物资厂家管理 */ @Override public SupplierInfo selectSupplierInfoBySupplierId(Long supplierId) @@ -33,10 +34,10 @@ public class SupplierInfoServiceImpl implements ISupplierInfoService } /** - * 查询供应商管理列表 + * 查询物资厂家管理列表 * - * @param supplierInfo 供应商管理 - * @return 供应商管理 + * @param supplierInfo 物资厂家管理 + * @return 物资厂家管理 */ @Override public List selectSupplierInfoList(SupplierInfo supplierInfo) @@ -45,9 +46,9 @@ public class SupplierInfoServiceImpl implements ISupplierInfoService } /** - * 新增供应商管理 + * 新增物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ @Override @@ -58,39 +59,36 @@ public class SupplierInfoServiceImpl implements ISupplierInfoService } /** - * 修改供应商管理 + * 修改物资厂家管理 * - * @param supplierInfo 供应商管理 + * @param supplierInfo 物资厂家管理 * @return 结果 */ @Override - public int updateSupplierInfo(SupplierInfo supplierInfo) - { + public int updateSupplierInfo(SupplierInfo supplierInfo) { supplierInfo.setUpdateTime(DateUtils.getNowDate()); return supplierInfoMapper.updateSupplierInfo(supplierInfo); } /** - * 批量删除供应商管理 + * 批量删除物资厂家管理 * - * @param supplierIds 需要删除的供应商管理主键 + * @param supplierIds 需要删除的物资厂家管理主键 * @return 结果 */ @Override - public int deleteSupplierInfoBySupplierIds(Long[] supplierIds) - { + public int deleteSupplierInfoBySupplierIds(Long[] supplierIds) { return supplierInfoMapper.deleteSupplierInfoBySupplierIds(supplierIds); } /** - * 删除供应商管理信息 + * 删除物资厂家管理信息 * - * @param supplierId 供应商管理主键 + * @param supplierId 物资厂家管理主键 * @return 结果 */ @Override - public int deleteSupplierInfoBySupplierId(Long supplierId) - { + public int deleteSupplierInfoBySupplierId(Long supplierId) { return supplierInfoMapper.deleteSupplierInfoBySupplierId(supplierId); } } diff --git a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml b/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml index e0b166ef..be72758f 100644 --- a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml +++ b/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml @@ -9,12 +9,10 @@ spring: discovery: # 服务注册地址 server-addr: 127.0.0.1:8848 - # namespace: sgzb_bns namespace: sgzb_bns config: # 配置中心地址 server-addr: 127.0.0.1:8848 - # namespace: sgzb_bns namespace: sgzb_bns # 配置文件格式 file-extension: yml diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/SupplierInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/SupplierInfoMapper.xml index dbba8ae6..cc2cae3c 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/SupplierInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/SupplierInfoMapper.xml @@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and business_license = #{businessLicense} and company_id = #{companyId} and status = #{status} + and del_flag = '0' @@ -59,8 +60,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag, create_by, create_time, - update_by, - update_time, remark, company_id, status, @@ -76,8 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{delFlag}, #{createBy}, #{createTime}, - #{updateBy}, - #{updateTime}, #{remark}, #{companyId}, #{status}, @@ -94,9 +91,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" phone = #{phone}, business_scope = #{businessScope}, business_license = #{businessLicense}, - del_flag = #{delFlag}, - create_by = #{createBy}, - create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, @@ -107,11 +101,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from ma_supplier_info where supplier_id = #{supplierId} + update ma_supplier_info set del_flag = 2 where supplier_id = #{supplierId} - delete from ma_supplier_info where supplier_id in + update ma_supplier_info set del_flag = 2 where supplier_id in #{supplierId}