5 changed files with 226 additions and 0 deletions
@ -0,0 +1,114 @@ |
|||||
|
package com.kms.system.controller; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.jianwei.common.core.controller.BaseController; |
||||
|
import com.jianwei.common.core.domain.SearchParam; |
||||
|
import com.jianwei.common.utils.poi.ExcelUtil; |
||||
|
import com.kms.common.utils.BaseEntityUtils; |
||||
|
|
||||
|
|
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.PutMapping; |
||||
|
import org.springframework.web.bind.annotation.DeleteMapping; |
||||
|
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.RestController; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
||||
|
|
||||
|
import com.jianwei.common.annotation.Log; |
||||
|
import com.jianwei.common.core.domain.AjaxResult; |
||||
|
import com.jianwei.common.enums.BusinessType; |
||||
|
import com.kms.system.domain.SysUserEnterprise; |
||||
|
import com.kms.system.service.SysUserEnterpriseService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 用户企业Controller |
||||
|
* |
||||
|
* @author kms |
||||
|
* @date 2024-03-26 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/system/userEnterprise") |
||||
|
@Api(tags = "用户企业") |
||||
|
public class SysUserEnterpriseController extends BaseController |
||||
|
{ |
||||
|
@Autowired |
||||
|
private SysUserEnterpriseService sysUserEnterpriseService; |
||||
|
|
||||
|
/** |
||||
|
* 查询用户企业列表 |
||||
|
*/ |
||||
|
@PostMapping("/list") |
||||
|
@ApiOperation("用户企业列表") |
||||
|
public IPage list(@RequestBody SearchParam<SysUserEnterprise> sp) |
||||
|
{ |
||||
|
return sysUserEnterpriseService.selectPage(sp); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出用户企业列表 |
||||
|
*/ |
||||
|
@Log(title = "用户企业导出", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
@ApiOperation("用户企业导出") |
||||
|
public AjaxResult export(@RequestBody SysUserEnterprise sysUserEnterprise) |
||||
|
{ |
||||
|
List<SysUserEnterprise> list = sysUserEnterpriseService.listByIds(sysUserEnterprise.getIds()); |
||||
|
ExcelUtil<SysUserEnterprise> util = new ExcelUtil<>(SysUserEnterprise.class); |
||||
|
return util.exportExcel(list, "userEnterprise"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取用户企业详细信息 |
||||
|
*/ |
||||
|
@ApiOperation(" 用户企业详情") |
||||
|
@GetMapping(value = "/{id}") |
||||
|
public AjaxResult getInfo(@PathVariable("id") String id) |
||||
|
{ |
||||
|
return AjaxResult.success(sysUserEnterpriseService.getById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增用户企业 |
||||
|
*/ |
||||
|
@Log(title = "用户企业新增", businessType = BusinessType.INSERT) |
||||
|
@PostMapping |
||||
|
@ApiOperation("用户企业新增") |
||||
|
public AjaxResult add(@RequestBody SysUserEnterprise sysUserEnterprise) |
||||
|
{ |
||||
|
BaseEntityUtils.preInsert(sysUserEnterprise); |
||||
|
return toAjax(sysUserEnterpriseService.save(sysUserEnterprise)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改用户企业 |
||||
|
*/ |
||||
|
@ApiOperation("用户企业修改") |
||||
|
@Log(title = "用户企业修改", businessType = BusinessType.UPDATE) |
||||
|
@PutMapping |
||||
|
public AjaxResult edit(@RequestBody SysUserEnterprise sysUserEnterprise) |
||||
|
{ |
||||
|
return toAjax(sysUserEnterpriseService.updateById(sysUserEnterprise)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除用户企业 |
||||
|
*/ |
||||
|
@ApiOperation("用户企业删除") |
||||
|
@Log(title = "用户企业删除", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public AjaxResult remove(@PathVariable String[] ids) |
||||
|
{ |
||||
|
return toAjax(sysUserEnterpriseService.removeByIds(Arrays.asList(ids))); |
||||
|
} |
||||
|
} |
@ -0,0 +1,50 @@ |
|||||
|
package com.kms.system.domain; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
|
import com.jianwei.common.annotation.Excel; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
|
||||
|
import com.jianwei.common.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* 用户企业对象 sys_user_enterprise |
||||
|
* |
||||
|
* @author kms |
||||
|
* @date 2024-03-26 |
||||
|
*/ |
||||
|
@TableName("sys_user_enterprise") |
||||
|
@Data |
||||
|
@ApiModel("用户企业") |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class SysUserEnterprise extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 用户id */ |
||||
|
@ApiModelProperty("${comment}") |
||||
|
private String userId; |
||||
|
|
||||
|
/** 企业id */ |
||||
|
@ApiModelProperty("${comment}") |
||||
|
private String enterpriseId; |
||||
|
|
||||
|
/** $column.columnComment */ |
||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
||||
|
@ApiModelProperty("${comment}") |
||||
|
private String createUid; |
||||
|
|
||||
|
/** $column.columnComment */ |
||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
||||
|
@ApiModelProperty("${comment}") |
||||
|
private String updateUid; |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.kms.system.mapper; |
||||
|
|
||||
|
import org.springframework.stereotype.Repository; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.kms.system.domain.SysUserEnterprise; |
||||
|
|
||||
|
/** |
||||
|
* 用户企业Mapper接口 |
||||
|
* |
||||
|
* @author kms |
||||
|
* @date 2024-03-26 |
||||
|
*/ |
||||
|
@Repository |
||||
|
public interface SysUserEnterpriseMapper extends BaseMapper<SysUserEnterprise> { |
||||
|
|
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.kms.system.service; |
||||
|
|
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.jianwei.common.core.service.BaseService; |
||||
|
import com.kms.system.mapper.SysUserEnterpriseMapper; |
||||
|
import com.kms.system.domain.SysUserEnterprise; |
||||
|
|
||||
|
/** |
||||
|
* 用户企业Service接口 |
||||
|
* |
||||
|
* @author kms |
||||
|
* @date 2024-03-26 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class SysUserEnterpriseService extends BaseService<SysUserEnterpriseMapper, SysUserEnterprise>{ |
||||
|
|
||||
|
} |
Loading…
Reference in new issue