物资厂家管理API

This commit is contained in:
syruan 2024-10-15 18:49:19 +08:00
parent e85219e6f5
commit 6cdf19cca3
7 changed files with 107 additions and 127 deletions

View File

@ -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<SupplierInfo> 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<SupplierInfo> list = supplierInfoService.selectSupplierInfoList(supplierInfo);
ExcelUtil<SupplierInfo> util = new ExcelUtil<SupplierInfo>(SupplierInfo.class);
util.exportExcel(response, list, "供应商管理数据");
ExcelUtil<SupplierInfo> 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));
}
}

View File

@ -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;

View File

@ -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<SupplierInfo> selectSupplierInfoList(SupplierInfo supplierInfo);
List<SupplierInfo> 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);
}

View File

@ -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<SupplierInfo> selectSupplierInfoList(SupplierInfo supplierInfo);
List<SupplierInfo> 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);
}

View File

@ -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<SupplierInfo> 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);
}
}

View File

@ -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

View File

@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessLicense != null and businessLicense != ''"> and business_license = #{businessLicense}</if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId}</if>
<if test="status != null "> and status = #{status}</if>
and del_flag = '0'
</where>
</select>
@ -59,8 +60,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
<if test="status != null">status,</if>
@ -76,8 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>
<if test="status != null">#{status},</if>
@ -94,9 +91,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null">phone = #{phone},</if>
<if test="businessScope != null">business_scope = #{businessScope},</if>
<if test="businessLicense != null">business_license = #{businessLicense},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
@ -107,11 +101,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteSupplierInfoBySupplierId" parameterType="Long">
delete from ma_supplier_info where supplier_id = #{supplierId}
update ma_supplier_info set del_flag = 2 where supplier_id = #{supplierId}
</delete>
<delete id="deleteSupplierInfoBySupplierIds" parameterType="String">
delete from ma_supplier_info where supplier_id in
update ma_supplier_info set del_flag = 2 where supplier_id in
<foreach item="supplierId" collection="array" open="(" separator="," close=")">
#{supplierId}
</foreach>