Commit 606b59a2 by rongkailun

【新增】提供商管理

parent 9ced1266
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.PartnersEntity;
import io.office.modules.manage.service.PartnersService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* 标准服务 提供商管理
*
* @author rkl
* @email
* @date 2021-11-16 08:59:11
*/
@RestController
@RequestMapping("/partners")
public class PartnersController {
@Autowired
private PartnersService partnersService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:partners:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = partnersService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:partners:info")
public R info(@PathVariable("id") Integer id){
PartnersEntity partners = partnersService.getById(id);
return R.ok().put("partners", partners);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:partners:save")
public R save(@RequestBody PartnersEntity partners){
partnersService.save(partners);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:partners:update")
public R update(@RequestBody PartnersEntity partners){
partnersService.updateById(partners);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:partners:delete")
public R delete(@RequestBody Integer[] ids){
partnersService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.PartnersEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 提供商管理
*
* @author rkl
* @email
* @date 2021-11-16 08:59:11
*/
@Mapper
public interface PartnersDao extends BaseMapper<PartnersEntity> {
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 提供商服务
*
* @author rkl
* @email
* @date 2021-11-16 08:59:11
*/
@Data
@TableName("Partners")
public class PartnersEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer id;
/**
* $column.comments
*/
private String firmname;
/**
* $column.comments
*/
private String brief;
/**
* $column.comments
*/
private String pic;
/**
* $column.comments
*/
private String technology;
/**
* $column.comments
*/
private String service;
/**
* $column.comments
*/
private String site;
/**
* $column.comments
*/
private String name;
/**
* $column.comments
*/
private String phone;
/**
* $column.comments
*/
private String email;
/**
* $column.comments
*/
private Date registerdate;
/**
* $column.comments
*/
private Date updatedate;
/**
* $column.comments
*/
private String editor;
/**
* $column.comments
*/
private String lasteditor;
/**
* $column.comments
*/
private Integer levels;
/**
* $column.comments
*/
private Integer status;
/**
* $column.comments
*/
private String auditor;
/**
* $column.comments
*/
private Date checkdate;
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.PartnersEntity;
import java.util.Map;
/**
* 提供商管理
*
* @author rkl
* @email
* @date 2021-11-16 08:59:11
*/
public interface PartnersService extends IService<PartnersEntity> {
PageUtils queryPage(Map<String, Object> params);
}
package io.office.modules.manage.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.PartnersDao;
import io.office.modules.manage.entity.PartnersEntity;
import io.office.modules.manage.service.PartnersService;
@Service("partnersService")
public class PartnersServiceImpl extends ServiceImpl<PartnersDao, PartnersEntity> implements PartnersService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<PartnersEntity> page = this.page(
new Query<PartnersEntity>().getPage(params),
new QueryWrapper<PartnersEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
<?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="io.office.modules.manage.dao.PartnersDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.PartnersEntity" id="partnersMap">
<result property="id" column="id"/>
<result property="firmname" column="firmname"/>
<result property="brief" column="brief"/>
<result property="pic" column="pic"/>
<result property="technology" column="technology"/>
<result property="service" column="service"/>
<result property="site" column="site"/>
<result property="name" column="name"/>
<result property="phone" column="phone"/>
<result property="email" column="email"/>
<result property="registerdate" column="registerdate"/>
<result property="updatedate" column="updatedate"/>
<result property="editor" column="editor"/>
<result property="lasteditor" column="lasteditor"/>
<result property="levels" column="levels"/>
<result property="status" column="status"/>
<result property="auditor" column="auditor"/>
<result property="checkdate" column="checkdate"/>
</resultMap>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment