Merge remote-tracking branch 'origin/master'

This commit is contained in:
lijiaqi 2023-02-03 09:13:57 +08:00
commit b9b4ab1021
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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@ -21,7 +22,7 @@ public class MechanismController extends BaseController {
@PostMapping("/saveMechanism") @PostMapping("/saveMechanism")
@ApiOperation(value = "新增机构信息") @ApiOperation(value = "新增机构信息")
public AjaxResult saveMechanism(@RequestBody Mechanism mechanism) { public AjaxResult saveMechanism(@RequestBody @Validated Mechanism mechanism) {
return mechanismService.saveMechanism(mechanism); return mechanismService.saveMechanism(mechanism);
} }

View File

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

View File

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

View File

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

View File

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

View File

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