内设机构

This commit is contained in:
zhuyy 2023-02-02 17:33:11 +08:00
parent cd66b4b0f5
commit fad900595f
6 changed files with 33 additions and 6 deletions

View File

@ -9,6 +9,7 @@ import com.ydool.system.request.IdsRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@RestController
@ -21,7 +22,7 @@ public class MechanismController extends BaseController {
@PostMapping("/saveMechanism")
@ApiOperation(value = "新增机构信息")
public AjaxResult saveMechanism(@RequestBody Mechanism mechanism) {
public AjaxResult saveMechanism(@RequestBody @Validated Mechanism mechanism) {
return mechanismService.saveMechanism(mechanism);
}

View File

@ -1,5 +1,6 @@
package com.ydool.staff.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.base.BaseController;
import com.ydool.common.constant.UrlConstant;
import com.ydool.common.data.dto.AjaxResult;
@ -9,10 +10,8 @@ import com.ydool.system.request.IdsRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(UrlConstant.PARTY_ORGANIZATION)
@ -22,9 +21,15 @@ public class PartyOrganizationController extends BaseController {
@Autowired
IPartyOrganizationService partyOrganizationService;
@GetMapping("/selectPartyOrganizationList")
@ApiOperation(value = "党组织信息列表")
public AjaxResult selectPartyOrganizationList() {
return partyOrganizationService.selectPartyOrganizationList(new Page<PartyOrganization>(getPageNum(), getPageSize()));
}
@PostMapping("/savePartyOrganization")
@ApiOperation(value = "新增党组织信息")
public AjaxResult savePartyOrganization(@RequestBody PartyOrganization partyOrganization) {
public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) {
return partyOrganizationService.savePartyOrganization(partyOrganization);
}

View File

@ -6,6 +6,9 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
/**
* <p>
* 内设机构信息
@ -24,12 +27,15 @@ public class Mechanism extends BaseEntity{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "企业id")
@NotBlank(message = "企业Id不能为空")
private String organizationId;
@ApiModelProperty(value = "机构名称")
@NotBlank(message = "机构名称不能为空")
private String mechanismName;
@ApiModelProperty(value = "机构职能")
@NotBlank(message = "机构职能不能为空")
private String mechanismFunction;
@ApiModelProperty(value = "负责人")

View File

@ -6,6 +6,9 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
/**
* <p>
* 党组织信息
@ -24,12 +27,15 @@ public class PartyOrganization extends BaseEntity{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "企业Id")
@NotBlank(message = "企业Id不能为空")
private String organizationId;
@ApiModelProperty(value = "姓名")
@NotBlank(message = "姓名不能为空")
private String username;
@ApiModelProperty(value = "职务")
@NotBlank(message = "职务不能为空")
private String job;
}

View File

@ -1,5 +1,6 @@
package com.ydool.staff.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.PartyOrganization;
import com.ydool.system.request.IdsRequest;
@ -17,5 +18,7 @@ public interface IPartyOrganizationService {
AjaxResult savePartyOrganization(PartyOrganization partyOrganization);
AjaxResult deletePartyOrganization(IdsRequest id);
AjaxResult selectPartyOrganizationList(Page<PartyOrganization> partyOrganizationPage);
}

View File

@ -1,6 +1,7 @@
package com.ydool.staff.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.PartyOrganization;
import com.ydool.common.base.BaseService;
@ -44,5 +45,10 @@ public class PartyOrganizationServiceImpl extends BaseService<PartyOrganizationM
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
}
}
@Override
public AjaxResult selectPartyOrganizationList(Page<PartyOrganization> partyOrganizationPage) {
return AjaxResult.ok().data(partyOrganizationMapper.selectPage(partyOrganizationPage, null));
}
}