diff --git a/src/main/java/com/ydool/staff/controller/MechanismController.java b/src/main/java/com/ydool/staff/controller/MechanismController.java deleted file mode 100644 index 2052c82..0000000 --- a/src/main/java/com/ydool/staff/controller/MechanismController.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.ydool.staff.controller; - -import com.ydool.common.base.BaseController; -import com.ydool.common.constant.UrlConstant; -import com.ydool.common.data.dto.AjaxResult; -import com.ydool.staff.entity.Mechanism; -import com.ydool.staff.service.IMechanismService; -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 -// @RequestMapping(UrlConstant.MECHANISM) -// @Api(tags = "机构信息", value = "机构信息") -public class MechanismController extends BaseController { - - // @Autowired - // IMechanismService mechanismService; - // - // @PostMapping("/saveMechanism") - // @ApiOperation(value = "新增机构信息") - // public AjaxResult saveMechanism(@RequestBody @Validated Mechanism mechanism) { - // return mechanismService.saveMechanism(mechanism); - // } - // - // @PostMapping("/deleteMechanism") - // @ApiOperation(value = "删除机构信息") - // public AjaxResult deleteMechanism(@RequestBody IdsRequest id) { - // return mechanismService.deleteMechanism(id); - // } - -} diff --git a/src/main/java/com/ydool/staff/controller/PartyOrganizationController.java b/src/main/java/com/ydool/staff/controller/PartyOrganizationController.java deleted file mode 100644 index de51d49..0000000 --- a/src/main/java/com/ydool/staff/controller/PartyOrganizationController.java +++ /dev/null @@ -1,42 +0,0 @@ -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; -import com.ydool.staff.entity.PartyOrganization; -import com.ydool.staff.service.IPartyOrganizationService; -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 -// @RequestMapping(UrlConstant.PARTY_ORGANIZATION) -// @Api(tags = "党组织信息", value = "党组织信息") -public class PartyOrganizationController extends BaseController { - - // @Autowired - // IPartyOrganizationService partyOrganizationService; - // - // @GetMapping("/selectPartyOrganizationList") - // @ApiOperation(value = "党组织信息列表") - // public AjaxResult selectPartyOrganizationList() { - // return partyOrganizationService.selectPartyOrganizationList(new Page(getPageNum(), getPageSize())); - // } - // - // @PostMapping("/savePartyOrganization") - // @ApiOperation(value = "新增党组织信息") - // public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) { - // return partyOrganizationService.savePartyOrganization(partyOrganization); - // } - // - // @PostMapping("/deletePartyOrganization") - // @ApiOperation(value = "删除党组织信息") - // public AjaxResult deletePartyOrganization(@RequestBody IdsRequest id) { - // return partyOrganizationService.deletePartyOrganization(id); - // } - -} diff --git a/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java b/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java index 9e8503b..e0d1cc8 100644 --- a/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java +++ b/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java @@ -112,6 +112,9 @@ public class DirectorsSupervisors extends BaseEntity { @ApiModelProperty(value = "终审意见") private String lastInstance; + @ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝\n") + private Integer auditState; + @ApiModelProperty(value = "附件") @TableField(exist = false) private List attachmentDtoList; diff --git a/src/main/java/com/ydool/staff/entity/Mechanism.java b/src/main/java/com/ydool/staff/entity/Mechanism.java deleted file mode 100644 index 1b511ba..0000000 --- a/src/main/java/com/ydool/staff/entity/Mechanism.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.ydool.staff.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.ydool.common.base.BaseEntity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; - -/** - *

- * 内设机构信息 - *

- * - * @author msf - * @since 2023-02-02 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -@TableName("t_lc_mechanism") -@ApiModel(value="Mechanism对象", description="内设机构信息") -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 = "负责人") - private String responsiblePerson; - - @ApiModelProperty(value = "备注") - private String remark; - -} diff --git a/src/main/java/com/ydool/staff/entity/PartyOrganization.java b/src/main/java/com/ydool/staff/entity/PartyOrganization.java deleted file mode 100644 index ce2d7d3..0000000 --- a/src/main/java/com/ydool/staff/entity/PartyOrganization.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.ydool.staff.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.ydool.common.base.BaseEntity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; - -/** - *

- * 党组织信息 - *

- * - * @author msf - * @since 2023-02-02 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -@TableName("t_lc_party_organization") -@ApiModel(value="PartyOrganization对象", description="党组织信息") -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; - -} diff --git a/src/main/java/com/ydool/staff/entity/PersonnelIndicators.java b/src/main/java/com/ydool/staff/entity/PersonnelIndicators.java index 67334a2..5b306bf 100644 --- a/src/main/java/com/ydool/staff/entity/PersonnelIndicators.java +++ b/src/main/java/com/ydool/staff/entity/PersonnelIndicators.java @@ -38,10 +38,10 @@ public class PersonnelIndicators extends BaseEntity { private String indexExplain; @ApiModelProperty(value = "标准指标人数") - private Long standardNumber; + private String standardNumber; @ApiModelProperty(value = "增加指标人数") - private Long addNumber; + private String addNumber; @ApiModelProperty(value = "初审意见") private String firstTrial; @@ -54,4 +54,7 @@ public class PersonnelIndicators extends BaseEntity { @ApiModelProperty(value = "单据状态") private String documentStatus; + + @ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝") + private Integer auditState; } diff --git a/src/main/java/com/ydool/staff/entity/Recruitment.java b/src/main/java/com/ydool/staff/entity/Recruitment.java index b8dbef1..dfffc80 100644 --- a/src/main/java/com/ydool/staff/entity/Recruitment.java +++ b/src/main/java/com/ydool/staff/entity/Recruitment.java @@ -39,13 +39,13 @@ public class Recruitment extends BaseEntity { private String position; @ApiModelProperty(value = "名额") - private Long places; + private String places; @ApiModelProperty(value = "条件要求") private String requirements; - @ApiModelProperty(value = "审批") - private Long approval; + @ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝\n") + private Integer auditState; @ApiModelProperty(value = "初审意见") private String firstTrial; diff --git a/src/main/java/com/ydool/staff/mapper/MechanismMapper.java b/src/main/java/com/ydool/staff/mapper/MechanismMapper.java deleted file mode 100644 index d453e41..0000000 --- a/src/main/java/com/ydool/staff/mapper/MechanismMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ydool.staff.mapper; - -import com.ydool.staff.entity.Mechanism; -import com.github.yulichang.base.MPJBaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 内设机构信息 Mapper 接口 - *

- * - * @author msf - * @since 2023-02-02 - */ -@Mapper -public interface MechanismMapper extends MPJBaseMapper { - -} diff --git a/src/main/java/com/ydool/staff/mapper/PartyOrganizationMapper.java b/src/main/java/com/ydool/staff/mapper/PartyOrganizationMapper.java deleted file mode 100644 index 27cd9b6..0000000 --- a/src/main/java/com/ydool/staff/mapper/PartyOrganizationMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ydool.staff.mapper; - -import com.ydool.staff.entity.PartyOrganization; -import com.github.yulichang.base.MPJBaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - *

- * 党组织信息 Mapper 接口 - *

- * - * @author msf - * @since 2023-02-02 - */ -@Mapper -public interface PartyOrganizationMapper extends MPJBaseMapper { - -} diff --git a/src/main/java/com/ydool/staff/request/MechanismPartyOrganization.java b/src/main/java/com/ydool/staff/request/MechanismPartyOrganization.java deleted file mode 100644 index ec0969b..0000000 --- a/src/main/java/com/ydool/staff/request/MechanismPartyOrganization.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ydool.staff.request; - -import com.ydool.staff.entity.Mechanism; -import com.ydool.staff.entity.PartyOrganization; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -/** - * @Author Zhuyy - * @ClassName MechanismPartyOrganization - * @Description TODO - * @date 2023/2/10 15:35 - * @Version 1.0 - */ -@Data -public class MechanismPartyOrganization implements Serializable { - - @ApiModelProperty(value = "内设机构信息") - private List mechanisms; - - @ApiModelProperty(value = "党组织信息") - private List partyOrganizations; -} diff --git a/src/main/java/com/ydool/staff/request/MechanismRequest.java b/src/main/java/com/ydool/staff/request/MechanismRequest.java deleted file mode 100644 index f3c05f7..0000000 --- a/src/main/java/com/ydool/staff/request/MechanismRequest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.ydool.staff.request; - -import com.ydool.staff.dto.AttachmentDto; -import com.ydool.staff.entity.Attachment; -import com.ydool.staff.entity.Mechanism; -import com.ydool.staff.entity.PartyOrganization; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import java.io.Serializable; -import java.util.List; - -@Data -public class MechanismRequest implements Serializable { - - @ApiModelProperty(value = "企业id") - @NotBlank(message = "企业id不能为空") - private String companyId; - - @ApiModelProperty(value = "信用代码") - private String creditCode; - - @ApiModelProperty(value = "备注") - private String remark; - - @ApiModelProperty(value = "附件列表") - private List attachmentsDto; - - @ApiModelProperty(value = "机构信息") - @NotEmpty(message = "机构信息不能为空") - private List mechanism; - - @ApiModelProperty(value = "党组织信息") - @NotEmpty(message = "党组织信息不能为空") - private List partyOrganizations; -} diff --git a/src/main/java/com/ydool/staff/request/OrganizationRequest.java b/src/main/java/com/ydool/staff/request/OrganizationRequest.java index 567d3cc..e335204 100644 --- a/src/main/java/com/ydool/staff/request/OrganizationRequest.java +++ b/src/main/java/com/ydool/staff/request/OrganizationRequest.java @@ -3,6 +3,7 @@ package com.ydool.staff.request; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; @Data @@ -29,9 +30,14 @@ public class OrganizationRequest implements Serializable { @ApiModelProperty(value = "剩余指标人数") private Long residualNumber; - @ApiModelProperty(value = "类型") + @ApiModelProperty(value = "类型 登记organization 申报personnel_indicators") + @NotBlank(message = "类型不能为空") private String type; + @ApiModelProperty(value = "单据状态 默认国资审核,送审") + @NotBlank(message = "单据状态不能为空") + private String documentStatus; + @ApiModelProperty(value = "备注") private String remark; } diff --git a/src/main/java/com/ydool/staff/request/OrganizationSearch.java b/src/main/java/com/ydool/staff/request/OrganizationSearch.java index 6ddfd5f..98522e7 100644 --- a/src/main/java/com/ydool/staff/request/OrganizationSearch.java +++ b/src/main/java/com/ydool/staff/request/OrganizationSearch.java @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; +import java.io.Serializable; /** * @Author Zhuyy @@ -14,7 +15,7 @@ import javax.validation.constraints.NotBlank; */ @Data -public class OrganizationSearch { +public class OrganizationSearch implements Serializable { @ApiModelProperty(value = "企业名称") private String companyName; @@ -22,6 +23,15 @@ public class OrganizationSearch { @ApiModelProperty(value = "审批单号") private String approvalNumber; + @ApiModelProperty(value = "单据状态") + private String documentStatus; + + @ApiModelProperty(value = "填报开始时间") + private String createdAt; + + @ApiModelProperty(value = "填报结束时间") + private String updatedAt; + @ApiModelProperty(value = "类型") @NotBlank(message = "类型不能为空") private String type; diff --git a/src/main/java/com/ydool/staff/request/PersonnelIndicatorsRequest.java b/src/main/java/com/ydool/staff/request/PersonnelIndicatorsRequest.java index a737ce7..2234cd0 100644 --- a/src/main/java/com/ydool/staff/request/PersonnelIndicatorsRequest.java +++ b/src/main/java/com/ydool/staff/request/PersonnelIndicatorsRequest.java @@ -4,6 +4,7 @@ import com.ydool.staff.entity.PersonnelIndicators; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.Valid; import java.io.Serializable; import java.util.List; @@ -18,6 +19,7 @@ import java.util.List; public class PersonnelIndicatorsRequest implements Serializable { @ApiModelProperty(value = "人员指标") + @Valid private OrganizationRequest organizationRequest; @ApiModelProperty(value = "人员指标申报") diff --git a/src/main/java/com/ydool/staff/request/RecruitmentRequest.java b/src/main/java/com/ydool/staff/request/RecruitmentRequest.java index 6f1e3ff..9dbd850 100644 --- a/src/main/java/com/ydool/staff/request/RecruitmentRequest.java +++ b/src/main/java/com/ydool/staff/request/RecruitmentRequest.java @@ -4,6 +4,7 @@ import com.ydool.staff.entity.Recruitment; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.Valid; import java.io.Serializable; import java.util.List; @@ -11,6 +12,7 @@ import java.util.List; public class RecruitmentRequest implements Serializable { @ApiModelProperty(value = "招聘登记") + @Valid private OrganizationRequest organizationRequest; @ApiModelProperty(value = "人员招聘登记") diff --git a/src/main/java/com/ydool/staff/service/IMechanismService.java b/src/main/java/com/ydool/staff/service/IMechanismService.java deleted file mode 100644 index 3fc0da8..0000000 --- a/src/main/java/com/ydool/staff/service/IMechanismService.java +++ /dev/null @@ -1,38 +0,0 @@ -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.Mechanism; -import com.ydool.staff.request.MechanismRequest; -import com.ydool.staff.request.OrganizationRequest; -import com.ydool.system.request.IdsRequest; - -/** - *

- * 内设机构信息 服务类 - *

- * - * @author msf - * @since 2023-02-02 - */ -public interface IMechanismService { - - /** - * 新增机构 - * @param mechanism - * @return - */ - AjaxResult saveMechanism(Mechanism mechanism); - - /** - * 删除机构 - * @param id - * @return - */ - AjaxResult deleteMechanism(IdsRequest id); - - AjaxResult saveMechanismPartyOrganization(MechanismRequest mechanismRequest); - - AjaxResult selectCompanyNameByIdMechanismPartyOrganization(String id); -} - diff --git a/src/main/java/com/ydool/staff/service/IPartyOrganizationService.java b/src/main/java/com/ydool/staff/service/IPartyOrganizationService.java deleted file mode 100644 index 148ac02..0000000 --- a/src/main/java/com/ydool/staff/service/IPartyOrganizationService.java +++ /dev/null @@ -1,24 +0,0 @@ -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; - -/** - *

- * 党组织信息 服务类 - *

- * - * @author msf - * @since 2023-02-02 - */ -public interface IPartyOrganizationService { - - AjaxResult savePartyOrganization(PartyOrganization partyOrganization); - - AjaxResult deletePartyOrganization(IdsRequest id); - - AjaxResult selectPartyOrganizationList(Page partyOrganizationPage); -} - diff --git a/src/main/java/com/ydool/staff/service/impl/CompanyNameServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/CompanyNameServiceImpl.java index f669a2d..68d05ff 100644 --- a/src/main/java/com/ydool/staff/service/impl/CompanyNameServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/CompanyNameServiceImpl.java @@ -44,7 +44,7 @@ public class CompanyNameServiceImpl extends BaseService().eq(CompanyName::getId, id)); - companyName.setActiveStaff(Long.valueOf(personnelMapper.selectCount(new LambdaQueryWrapper().eq(Personnel::getWorkState, "在职").eq(Personnel::getCompanyName, id)))); + companyName.setActiveStaff(Long.valueOf(personnelMapper.selectCount(new LambdaQueryWrapper().eq(Personnel::getWorkState, "在职").eq(Personnel::getPersonnelType,"指标内").eq(Personnel::getCompanyName, id)))); return AjaxResult.ok().data(companyName); } diff --git a/src/main/java/com/ydool/staff/service/impl/MechanismServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/MechanismServiceImpl.java deleted file mode 100644 index c0e5c46..0000000 --- a/src/main/java/com/ydool/staff/service/impl/MechanismServiceImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.ydool.staff.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.ydool.common.constant.ArgsConst; -import com.ydool.common.data.dto.AjaxResult; -import com.ydool.staff.dto.AttachmentDto; -import com.ydool.staff.entity.Attachment; -import com.ydool.staff.entity.Mechanism; -import com.ydool.common.base.BaseService; -import com.ydool.staff.entity.Organization; -import com.ydool.staff.entity.PartyOrganization; -import com.ydool.staff.mapper.AttachmentMapper; -import com.ydool.staff.mapper.MechanismMapper; -import com.ydool.staff.mapper.OrganizationMapper; -import com.ydool.staff.mapper.PartyOrganizationMapper; -import com.ydool.staff.request.AttachmentRequest; -import com.ydool.staff.request.MechanismPartyOrganization; -import com.ydool.staff.request.MechanismRequest; -import com.ydool.staff.request.OrganizationRequest; -import com.ydool.staff.service.IMechanismService; -import com.ydool.system.request.IdsRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.thymeleaf.util.StringUtils; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - *

- * 内设机构信息 服务类 - *

- * - * @author msf - * @since 2023-02-02 - */ -@Service -public class MechanismServiceImpl extends BaseService implements IMechanismService { - - @Autowired - MechanismMapper mechanismMapper; - @Autowired - OrganizationMapper organizationMapper; - @Autowired - AttachmentMapper attachmentMapper; - @Autowired - PartyOrganizationMapper partyOrganizationMapper; - - @Override - @Transactional(rollbackFor = Exception.class) - public AjaxResult saveMechanism(Mechanism mechanism) { - int i = mechanismMapper.insert(mechanism); - return i > 0 ? AjaxResult.ok().msg("新增成功!") : AjaxResult.fail().msg("新增失败!"); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public AjaxResult deleteMechanism(IdsRequest id) { - if (CollectionUtil.isEmpty(Arrays.asList(id.getIds()))) { - return AjaxResult.fail().msg("Id不能为空!"); - } else { - int i = mechanismMapper.deleteBatchIds(Arrays.asList(id.getIds())); - return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!"); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public AjaxResult saveMechanismPartyOrganization(MechanismRequest mechanismRequest) { - Organization organization = new Organization(); - List list = new ArrayList<>(); - List attachmentList = mechanismRequest.getAttachmentsDto(); - for (AttachmentDto attachment : attachmentList) { - list.add(attachment.getPath()); - } - organization.setAttachment(StringUtils.join(list, ",")); - organization.setCreditCode(mechanismRequest.getCreditCode()); - organization.setCompanyId(mechanismRequest.getCompanyId()); - organization.setRemark(mechanismRequest.getRemark()); - int i = organizationMapper.insert(organization); - if (i > 0) { - List attachments = mechanismRequest.getAttachmentsDto(); - List copyToList = BeanUtil.copyToList(attachments, Attachment.class); - for (Attachment attachment : copyToList) { - attachment.setTargetId(organization.getId()); - attachment.setTargetType(ArgsConst.ORGANIZATION); - attachmentMapper.insert(attachment); - } - // 机构信息 - List mechments = mechanismRequest.getMechanism(); - for (Mechanism mechment : mechments) { - int mechanism = mechanismMapper.selectCount(new LambdaQueryWrapper().eq(Mechanism::getOrganizationId, organization.getId()).eq(Mechanism::getId, mechment.getId())); - if (mechanism == 0) { - mechment.setOrganizationId(organization.getId()); - mechanismMapper.insert(mechment); - } else { - mechanismMapper.delete(new LambdaQueryWrapper().eq(Mechanism::getOrganizationId, organization.getId())); - } - } - // 党组织信息 - List partyOrganizations = mechanismRequest.getPartyOrganizations(); - for (PartyOrganization partyOrganization : partyOrganizations) { - int party = partyOrganizationMapper.selectCount(new LambdaQueryWrapper().eq(PartyOrganization::getOrganizationId, organization.getId()).eq(PartyOrganization::getId, partyOrganization.getId())); - if (party == 0) { - partyOrganization.setOrganizationId(organization.getId()); - partyOrganizationMapper.insert(partyOrganization); - } else { - partyOrganizationMapper.delete(new LambdaQueryWrapper().eq(PartyOrganization::getOrganizationId, organization.getId())); - } - } - return AjaxResult.ok().msg("新增成功!"); - } - return AjaxResult.fail().msg("新增失败!"); - } - - @Override - public AjaxResult selectCompanyNameByIdMechanismPartyOrganization(String id) { - if (StrUtil.isBlank(id)) { - return AjaxResult.fail().msg("企业id不能为空!"); - } - MechanismPartyOrganization mechanismPartyOrganization = new MechanismPartyOrganization(); - List mechanism = mechanismMapper.selectList(new LambdaQueryWrapper().eq(Mechanism::getOrganizationId, id)); - List partyOrganizations = partyOrganizationMapper.selectList(new LambdaQueryWrapper().eq(PartyOrganization::getOrganizationId, id)); - mechanismPartyOrganization.setMechanisms(mechanism); - mechanismPartyOrganization.setPartyOrganizations(partyOrganizations); - return AjaxResult.ok().data(mechanismPartyOrganization); - } -} - diff --git a/src/main/java/com/ydool/staff/service/impl/OrganizationServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/OrganizationServiceImpl.java index 007eeae..9ab5434 100644 --- a/src/main/java/com/ydool/staff/service/impl/OrganizationServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/OrganizationServiceImpl.java @@ -10,7 +10,6 @@ import com.ydool.common.base.BaseService; import com.ydool.staff.mapper.*; import com.ydool.staff.request.OrganizationSearch; import com.ydool.staff.service.IOrganizationService; -import com.ydool.system.mapper.UserMapper; import com.ydool.system.request.IdsRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -33,8 +32,6 @@ public class OrganizationServiceImpl extends BaseService organizationLambdaQueryWrapper = new LambdaQueryWrapper<>(); organizationLambdaQueryWrapper.exists(StrUtil.isNotBlank(organizationSearch.getCompanyName()), "select t2.id from t_lc_company_name t2 where t_lc_organization.company_id = t2.id and t2.company_name like '%" + organizationSearch.getCompanyName() + "%'"); organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(organizationSearch.getApprovalNumber()), Organization::getApprovalNumber, organizationSearch.getApprovalNumber()); + organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(organizationSearch.getDocumentStatus()), Organization::getDocumentStatus, organizationSearch.getDocumentStatus()); + organizationLambdaQueryWrapper.ge(StrUtil.isNotBlank(organizationSearch.getCreatedAt()), Organization::getCreatedAt, organizationSearch.getCreatedAt()); + organizationLambdaQueryWrapper.le(StrUtil.isNotBlank(organizationSearch.getUpdatedAt()), Organization::getUpdatedAt, organizationSearch.getUpdatedAt()); organizationLambdaQueryWrapper.eq(Organization::getType, organizationSearch.getType()); Page selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper); for (Organization record : selectPage.getRecords()) { diff --git a/src/main/java/com/ydool/staff/service/impl/PartyOrganizationServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/PartyOrganizationServiceImpl.java deleted file mode 100644 index d438a52..0000000 --- a/src/main/java/com/ydool/staff/service/impl/PartyOrganizationServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -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; -import com.ydool.staff.mapper.PartyOrganizationMapper; -import com.ydool.staff.service.IPartyOrganizationService; -import com.ydool.system.request.IdsRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.validation.constraints.NotEmpty; -import java.util.Arrays; -import java.util.List; - -/** - *

- * 党组织信息 服务类 - *

- * - * @author msf - * @since 2023-02-02 - */ -@Service -public class PartyOrganizationServiceImpl extends BaseService implements IPartyOrganizationService { - - @Autowired - PartyOrganizationMapper partyOrganizationMapper; - - @Override - @Transactional(rollbackFor = Exception.class) - public AjaxResult savePartyOrganization(PartyOrganization partyOrganization) { - int i = partyOrganizationMapper.insert(partyOrganization); - return i > 0 ? AjaxResult.ok().msg("新增成功!") : AjaxResult.fail().msg("新增失败!"); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public AjaxResult deletePartyOrganization(IdsRequest id) { - if (CollectionUtil.isEmpty(Arrays.asList(id.getIds()))) { - return AjaxResult.fail().msg("Id不能为空!"); - } else { - int i = partyOrganizationMapper.deleteBatchIds(Arrays.asList(id.getIds())); - return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!"); - } - } - - @Override - public AjaxResult selectPartyOrganizationList(Page partyOrganizationPage) { - return AjaxResult.ok().data(partyOrganizationMapper.selectPage(partyOrganizationPage, null)); - } -} - diff --git a/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java index 2a14844..f3f1296 100644 --- a/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java @@ -1,6 +1,8 @@ package com.ydool.staff.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ydool.common.data.dto.AjaxResult; @@ -18,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; +import java.util.stream.Collectors; /** *

@@ -41,15 +44,20 @@ public class PersonnelIndicatorsServiceImpl extends BaseService 0) { List personnelIndicators = personnelIndicatorsRequest.getPersonnelIndicators(); + List list = personnelIndicators.stream().map(PersonnelIndicators::getAddNumber).collect(Collectors.toList()); for (PersonnelIndicators personnelIndicator : personnelIndicators) { + if (!NumberUtil.isNumber(personnelIndicator.getAddNumber()) || !NumberUtil.isNumber(personnelIndicator.getStandardNumber())){ + return AjaxResult.fail().msg("指标人数输入不合法!"); + } personnelIndicator.setOrganizationId(organization.getId()); + personnelIndicatorsMapper.insert(personnelIndicator); + return AjaxResult.ok().msg("添加成功!"); } - boolean batch = saveBatch(personnelIndicators); - return batch ? AjaxResult.ok().msg("添加成功!") : AjaxResult.fail().msg("添加失败!"); } return AjaxResult.fail().msg("添加失败!"); } @@ -62,16 +70,10 @@ public class PersonnelIndicatorsServiceImpl extends BaseService personnelIndicators = personnelIndicatorsMapper.selectList(new LambdaQueryWrapper().eq(PersonnelIndicators::getOrganizationId, organization.getId())); PersonnelIndicatorsDto recruitmentRequest = new PersonnelIndicatorsDto(); - organization.setActiveStaff((getPersonnelCount())); recruitmentRequest.setOrganization(organization); recruitmentRequest.setPersonnelIndicators(personnelIndicators); return AjaxResult.ok().data(recruitmentRequest); } - private Long getPersonnelCount() { - return Long.valueOf(personnelMapper.selectCount(new LambdaQueryWrapper().eq(Personnel::getWorkState, "在职"))); - } - - } diff --git a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java index e9a9f14..675b101 100644 --- a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java @@ -2,6 +2,7 @@ package com.ydool.staff.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ydool.common.data.dto.AjaxResult; @@ -10,7 +11,6 @@ import com.ydool.staff.entity.Organization; import com.ydool.staff.entity.Personnel; import com.ydool.staff.entity.Recruitment; import com.ydool.common.base.BaseService; -import com.ydool.staff.mapper.CompanyNameMapper; import com.ydool.staff.mapper.OrganizationMapper; import com.ydool.staff.mapper.PersonnelMapper; import com.ydool.staff.mapper.RecruitmentMapper; @@ -54,18 +54,21 @@ public class RecruitmentServiceImpl extends BaseService 0) { List recruitments = recruitmentRequest.getRecruitments(); for (Recruitment recruitment : recruitments) { + if (!NumberUtil.isNumber(recruitment.getPlaces())){ + return AjaxResult.fail().msg("名额输入不合法!"); + } recruitment.setCompanyId(organization.getId()); + recruitmentMapper.insert(recruitment); + return AjaxResult.ok().msg("添加成功!"); } - boolean batch = saveBatch(recruitments); - return batch ? AjaxResult.ok().msg("添加成功!") : AjaxResult.fail().msg("添加失败!"); - } else { - return AjaxResult.fail().msg("添加失败!"); } + return AjaxResult.fail().msg("添加失败!"); } @Override @@ -88,15 +91,10 @@ public class RecruitmentServiceImpl extends BaseService recruitments = recruitmentMapper.selectList(new LambdaQueryWrapper().eq(Recruitment::getCompanyId, organization.getId())); RecruitmentDto recruitmentRequest = new RecruitmentDto(); - organization.setActiveStaff(getPersonnelCount()); recruitmentRequest.setOrganization(organization); recruitmentRequest.setRecruitments(recruitments); return AjaxResult.ok().data(recruitmentRequest); } - private Long getPersonnelCount() { - return Long.valueOf(personnelMapper.selectCount(new LambdaQueryWrapper().eq(Personnel::getWorkState, "在职"))); - } - }