no commit message
This commit is contained in:
parent
edd048499e
commit
16e1eb7955
@ -1,112 +0,0 @@
|
||||
package com.ruoyi.project.mr.controller;
|
||||
|
||||
import com.ruoyi.common.utils.IdUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.project.mr.domain.BaseCompany;
|
||||
import com.ruoyi.project.mr.service.IBaseCompanyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公司管理Controller
|
||||
*
|
||||
* @author mr
|
||||
* @date 2020-01-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/company")
|
||||
public class BaseCompanyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBaseCompanyService baseCompanyService;
|
||||
|
||||
/**
|
||||
* 查询公司管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:company:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseCompany baseCompany)
|
||||
{
|
||||
startPage();
|
||||
List<BaseCompany> list = baseCompanyService.selectBaseCompanyList(baseCompany);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出公司管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:company:export')")
|
||||
@Log(title = "公司管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(BaseCompany baseCompany)
|
||||
{
|
||||
List<BaseCompany> list = baseCompanyService.selectBaseCompanyList(baseCompany);
|
||||
ExcelUtil<BaseCompany> util = new ExcelUtil<BaseCompany>(BaseCompany.class);
|
||||
return util.exportExcel(list, "公司信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公司管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:company:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return AjaxResult.success(baseCompanyService.selectBaseCompanyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公司管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:company:add')")
|
||||
@Log(title = "公司管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseCompany baseCompany)
|
||||
{
|
||||
baseCompany.setId(IdUtils.fastUUID());
|
||||
return toAjax(baseCompanyService.insertBaseCompany(baseCompany));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公司管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:company:edit')")
|
||||
@Log(title = "公司管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseCompany baseCompany)
|
||||
{
|
||||
return toAjax(baseCompanyService.updateBaseCompany(baseCompany));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公司管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:company:remove')")
|
||||
@Log(title = "公司管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(baseCompanyService.deleteBaseCompanyByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:company:edit')")
|
||||
@Log(title = "公司管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeEnabled")
|
||||
public AjaxResult changeEnabled(@RequestBody BaseCompany baseCompany)
|
||||
{
|
||||
baseCompany.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(baseCompanyService.updateBaseCompanyEnabled(baseCompany));
|
||||
}
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
package com.ruoyi.project.mr.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 公司管理对象 base_company
|
||||
*
|
||||
* @author mr
|
||||
* @date 2020-01-04
|
||||
*/
|
||||
public class BaseCompany extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** UUID */
|
||||
private String id;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Long sort;
|
||||
|
||||
/** 公司代码 */
|
||||
@Excel(name = "公司代码")
|
||||
private String codeid;
|
||||
|
||||
/** 公司简称 */
|
||||
@Excel(name = "公司简称")
|
||||
private String name;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String enabled;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setSort(Long sort)
|
||||
{
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Long getSort()
|
||||
{
|
||||
return sort;
|
||||
}
|
||||
public void setCodeid(String codeid)
|
||||
{
|
||||
this.codeid = codeid;
|
||||
}
|
||||
|
||||
public String getCodeid()
|
||||
{
|
||||
return codeid;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setEnabled(String enabled)
|
||||
{
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getEnabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("sort", getSort())
|
||||
.append("codeid", getCodeid())
|
||||
.append("name", getName())
|
||||
.append("enabled", getEnabled())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.ruoyi.project.mr.mapper;
|
||||
|
||||
import com.ruoyi.project.mr.domain.BaseCompany;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公司管理Mapper接口
|
||||
*
|
||||
* @author mr
|
||||
* @date 2020-01-04
|
||||
*/
|
||||
public interface BaseCompanyMapper
|
||||
{
|
||||
/**
|
||||
* 查询公司管理
|
||||
*
|
||||
* @param id 公司管理ID
|
||||
* @return 公司管理
|
||||
*/
|
||||
public BaseCompany selectBaseCompanyById(String id);
|
||||
|
||||
/**
|
||||
* 查询公司管理列表
|
||||
*
|
||||
* @param baseCompany 公司管理
|
||||
* @return 公司管理集合
|
||||
*/
|
||||
public List<BaseCompany> selectBaseCompanyList(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 新增公司管理
|
||||
*
|
||||
* @param baseCompany 公司管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseCompany(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 修改公司管理
|
||||
*
|
||||
* @param baseCompany 公司管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseCompany(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 删除公司管理
|
||||
*
|
||||
* @param id 公司管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCompanyById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除公司管理
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCompanyByIds(String[] ids);
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
package com.ruoyi.project.mr.service;
|
||||
|
||||
import com.ruoyi.project.mr.domain.BaseCompany;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公司管理Service接口
|
||||
*
|
||||
* @author mr
|
||||
* @date 2020-01-04
|
||||
*/
|
||||
public interface IBaseCompanyService
|
||||
{
|
||||
/**
|
||||
* 查询公司管理
|
||||
*
|
||||
* @param id 公司管理ID
|
||||
* @return 公司管理
|
||||
*/
|
||||
public BaseCompany selectBaseCompanyById(String id);
|
||||
|
||||
/**
|
||||
* 查询公司管理列表
|
||||
*
|
||||
* @param baseCompany 公司管理
|
||||
* @return 公司管理集合
|
||||
*/
|
||||
public List<BaseCompany> selectBaseCompanyList(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 新增公司管理
|
||||
*
|
||||
* @param baseCompany 公司管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseCompany(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 修改公司管理
|
||||
*
|
||||
* @param baseCompany 公司管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseCompany(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 批量删除公司管理
|
||||
*
|
||||
* @param ids 需要删除的公司管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCompanyByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除公司管理信息
|
||||
*
|
||||
* @param id 公司管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCompanyById(String id);
|
||||
|
||||
/**
|
||||
* 修改公司状态
|
||||
*
|
||||
* @param baseCompany 公司信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseCompanyEnabled(BaseCompany baseCompany);
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
package com.ruoyi.project.mr.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.project.mr.domain.BaseCompany;
|
||||
import com.ruoyi.project.mr.mapper.BaseCompanyMapper;
|
||||
import com.ruoyi.project.mr.service.IBaseCompanyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公司管理Service业务层处理
|
||||
*
|
||||
* @author mr
|
||||
* @date 2020-01-04
|
||||
*/
|
||||
@Service
|
||||
public class BaseCompanyServiceImpl implements IBaseCompanyService
|
||||
{
|
||||
@Autowired
|
||||
private BaseCompanyMapper baseCompanyMapper;
|
||||
|
||||
/**
|
||||
* 查询公司管理
|
||||
*
|
||||
* @param id 公司管理ID
|
||||
* @return 公司管理
|
||||
*/
|
||||
@Override
|
||||
public BaseCompany selectBaseCompanyById(String id)
|
||||
{
|
||||
return baseCompanyMapper.selectBaseCompanyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公司管理列表
|
||||
*
|
||||
* @param baseCompany 公司管理
|
||||
* @return 公司管理
|
||||
*/
|
||||
@Override
|
||||
public List<BaseCompany> selectBaseCompanyList(BaseCompany baseCompany)
|
||||
{
|
||||
return baseCompanyMapper.selectBaseCompanyList(baseCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公司管理
|
||||
*
|
||||
* @param baseCompany 公司管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseCompany(BaseCompany baseCompany)
|
||||
{
|
||||
baseCompany.setCreateTime(DateUtils.getNowDate());
|
||||
return baseCompanyMapper.insertBaseCompany(baseCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公司管理
|
||||
*
|
||||
* @param baseCompany 公司管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseCompany(BaseCompany baseCompany)
|
||||
{
|
||||
baseCompany.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseCompanyMapper.updateBaseCompany(baseCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除公司管理
|
||||
*
|
||||
* @param ids 需要删除的公司管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseCompanyByIds(String[] ids)
|
||||
{
|
||||
return baseCompanyMapper.deleteBaseCompanyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公司管理信息
|
||||
*
|
||||
* @param id 公司管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseCompanyById(String id)
|
||||
{
|
||||
return baseCompanyMapper.deleteBaseCompanyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*
|
||||
* @param baseCompany 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseCompanyEnabled(BaseCompany baseCompany)
|
||||
{
|
||||
return baseCompanyMapper.updateBaseCompany(baseCompany);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user