This commit is contained in:
zhuyy 2023-02-09 09:19:44 +08:00
parent a04528b33c
commit 2a2fcf3305
23 changed files with 397 additions and 93 deletions

View File

@ -20,20 +20,20 @@ import org.springframework.web.bind.annotation.RestController;
@ApiSupport(order = 1) @ApiSupport(order = 1)
public class CompanyNameController extends BaseController { public class CompanyNameController extends BaseController {
// @Autowired @Autowired
// ICompanyNameService companyNameService; ICompanyNameService companyNameService;
// @GetMapping("/companyList") @GetMapping("/companyList")
// @ApiOperation(value = "企业名称列表") @ApiOperation(value = "企业名称列表")
// public AjaxResult companyList() { public AjaxResult companyList() {
// return companyNameService.companyList(); return companyNameService.companyList();
// } }
// @GetMapping("/companyName") @GetMapping("/companyName")
// @ApiOperation(value = "根据企业名称查企业信息") @ApiOperation(value = "根据企业Id查企业信息")
// @ApiImplicitParam(value = "企业名称", name = "companyName", required = true) @ApiImplicitParam(value = "企业Id", name = "id", required = true)
// public AjaxResult companyName(String companyName) { public AjaxResult companyName(String id) {
// return companyNameService.companyName(companyName); return companyNameService.companyName(id);
// } }
} }

View File

@ -31,6 +31,13 @@ public class DirectorsSupervisorsController extends BaseController {
return directorsSupervisorsService.selectDirectorsSupervisorsList(new Page<>(getPageNum(), getPageSize()), directorsSupervisorsDto); return directorsSupervisorsService.selectDirectorsSupervisorsList(new Page<>(getPageNum(), getPageSize()), directorsSupervisorsDto);
} }
@GetMapping("/selectDirectorsSupervisorsById")
@ApiOperation(value = "董监任免申报详情")
@ApiImplicitParam(name = "id", value = "董监任免id", dataType = "String", required = true)
public AjaxResult selectDirectorsSupervisorsById(String id) {
return directorsSupervisorsService.selectDirectorsSupervisorsById(id);
}
@PostMapping("/saveDirectorsSupervisors") @PostMapping("/saveDirectorsSupervisors")
@ApiOperation(value = "新增董监任免申报") @ApiOperation(value = "新增董监任免申报")
public AjaxResult saveDirectorsSupervisors(@RequestBody @Validated DirectorsSupervisors directorsSupervisors) { public AjaxResult saveDirectorsSupervisors(@RequestBody @Validated DirectorsSupervisors directorsSupervisors) {

View File

@ -13,23 +13,23 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping(UrlConstant.MECHANISM) // @RequestMapping(UrlConstant.MECHANISM)
@Api(tags = "机构信息", value = "机构信息") // @Api(tags = "机构信息", value = "机构信息")
public class MechanismController extends BaseController { public class MechanismController extends BaseController {
@Autowired // @Autowired
IMechanismService mechanismService; // IMechanismService mechanismService;
//
@PostMapping("/saveMechanism") // @PostMapping("/saveMechanism")
@ApiOperation(value = "新增机构信息") // @ApiOperation(value = "新增机构信息")
public AjaxResult saveMechanism(@RequestBody @Validated Mechanism mechanism) { // public AjaxResult saveMechanism(@RequestBody @Validated Mechanism mechanism) {
return mechanismService.saveMechanism(mechanism); // return mechanismService.saveMechanism(mechanism);
} // }
//
@PostMapping("/deleteMechanism") // @PostMapping("/deleteMechanism")
@ApiOperation(value = "删除机构信息") // @ApiOperation(value = "删除机构信息")
public AjaxResult deleteMechanism(@RequestBody IdsRequest id) { // public AjaxResult deleteMechanism(@RequestBody IdsRequest id) {
return mechanismService.deleteMechanism(id); // return mechanismService.deleteMechanism(id);
} // }
} }

View File

@ -1,16 +1,22 @@
package com.ydool.staff.controller; package com.ydool.staff.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
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;
import com.ydool.staff.service.IOrganizationService; import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.entity.PartyOrganization;
import com.ydool.staff.request.MechanismRequest;
import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.service.*;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
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
@ -18,39 +24,110 @@ import org.springframework.web.bind.annotation.*;
@Api(tags = "内设机构登记", value = "内设机构登记") @Api(tags = "内设机构登记", value = "内设机构登记")
public class OrganizationController extends BaseController { public class OrganizationController extends BaseController {
@Autowired
ICompanyNameService companyNameService;
@Autowired @Autowired
IOrganizationService organizationService; IOrganizationService organizationService;
@Autowired
IPartyOrganizationService partyOrganizationService;
@Autowired
IMechanismService mechanismService;
@Autowired
IAttachmentService attachmentService;
@GetMapping("/selectOrganization") // @GetMapping("/selectOrganization")
@ApiOperation(value = "企业名称列表") // @ApiOperation(value = "企业名称列表")
public AjaxResult selectOrganization() { // @ApiOperationSupport(order = 1)
return organizationService.selectOrganization(); // public AjaxResult selectOrganization() {
} // return organizationService.selectOrganization();
// }
//
// @GetMapping("/selectOrganizationByName")
// @ApiOperation(value = "企业名称查企业信息")
// @ApiOperationSupport(order = 2)
// // @ApiImplicitParams({@ApiImplicitParam(name = "companyName", value = "企业名称", required = true)})
// public AjaxResult selectOrganizationByName(String companyName) {
// return organizationService.selectOrganizationByName(companyName);
// }
@GetMapping("/selectOrganizationByName") /**
@ApiOperation(value = "企业名称查企业信息") * =======================内设机构登记===========================
@ApiImplicitParams({@ApiImplicitParam(name = "companyName", value = "企业名称", required = true)}) * @return
public AjaxResult selectOrganizationByName(String companyName) { */
return organizationService.selectOrganizationByName(companyName);
}
@GetMapping("/selectOrganizationList") @GetMapping("/selectOrganizationList")
@ApiOperation(value = "内设机构登记列表") @ApiOperation(value = "内设机构登记列表")
@ApiOperationSupport(order = 1)
@ApiImplicitParams({@ApiImplicitParam(name = "companyName", value = "企业名称"), @ApiImplicitParam(name = "current", value = "当前页", dataType = "Integer"), @ApiImplicitParam(name = "size", value = "每页条数", dataType = "Integer"),}) @ApiImplicitParams({@ApiImplicitParam(name = "companyName", value = "企业名称"), @ApiImplicitParam(name = "current", value = "当前页", dataType = "Integer"), @ApiImplicitParam(name = "size", value = "每页条数", dataType = "Integer"),})
public AjaxResult selectOrganizationList(String companyName) { public AjaxResult selectOrganizationList(String companyName) {
return organizationService.selectOrganizationList(new Page<>(getPageNum(), getPageSize()), companyName); return organizationService.selectOrganizationList(new Page<>(getPageNum(), getPageSize()), companyName);
} }
@GetMapping("/selectOrganizationFileList")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "内设机构附件列表")
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "企业Id")})
public AjaxResult selectOrganizationFileList(String id){
return attachmentService.selectOrganizationFileList(id);
}
@GetMapping("/selectOrganizationByMechanism") @GetMapping("/selectOrganizationByMechanism")
@ApiOperation(value = "内设机构登记详情") @ApiOperation(value = "内设机构登记详情")
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "企业Id")}) @ApiOperationSupport(order = 4)
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "内设机构Id")})
public AjaxResult selectOrganizationByMechanism(String id) { public AjaxResult selectOrganizationByMechanism(String id) {
return organizationService.selectOrganizationByMechanism(id); return organizationService.selectOrganizationByMechanism(id);
} }
@PostMapping("/deleteOrganization") @PostMapping("/deleteOrganization")
@ApiOperation(value = "删除内设机构") @ApiOperation(value = "内设机构删除")
@ApiOperationSupport(order = 5)
public AjaxResult deleteOrganization(@RequestBody IdsRequest id) { public AjaxResult deleteOrganization(@RequestBody IdsRequest id) {
return organizationService.deleteOrganization(id); return organizationService.deleteOrganization(id);
} }
/**
* =======================机构信息=========================
* @return
*/
@PostMapping("/saveMechanism")
@ApiOperation(value = "机构信息新增")
@ApiOperationSupport(order = 6)
public AjaxResult saveMechanism(@RequestBody @Validated MechanismRequest mechanismRequest) {
return mechanismService.saveOrganizationMechanism(mechanismRequest);
}
// @PostMapping("/deleteMechanism")
// @ApiOperation(value = "机构信息删除")
// @ApiOperationSupport(order = 7)
// public AjaxResult deleteMechanism(@RequestBody IdsRequest id) {
// return mechanismService.deleteMechanism(id);
// }
/**
* ========================党组织信息========================
* @return
*/
// @GetMapping("/selectPartyOrganizationList")
// @ApiOperation(value = "党组织信息列表")
// @ApiOperationSupport(order = 8)
// public AjaxResult selectPartyOrganizationList() {
// return partyOrganizationService.selectPartyOrganizationList(new Page<PartyOrganization>(getPageNum(), getPageSize()));
// }
@PostMapping("/savePartyOrganization")
@ApiOperation(value = "党组织信息新增")
@ApiOperationSupport(order = 9)
public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) {
return partyOrganizationService.savePartyOrganization(partyOrganization);
}
// @PostMapping("/deletePartyOrganization")
// @ApiOperation(value = "党组织信息删除")
// @ApiOperationSupport(order = 10)
// public AjaxResult deletePartyOrganization(@RequestBody IdsRequest id) {
// return partyOrganizationService.deletePartyOrganization(id);
// }
} }

View File

@ -14,29 +14,29 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping(UrlConstant.PARTY_ORGANIZATION) // @RequestMapping(UrlConstant.PARTY_ORGANIZATION)
@Api(tags = "党组织信息", value = "党组织信息") // @Api(tags = "党组织信息", value = "党组织信息")
public class PartyOrganizationController extends BaseController { public class PartyOrganizationController extends BaseController {
@Autowired // @Autowired
IPartyOrganizationService partyOrganizationService; // IPartyOrganizationService partyOrganizationService;
//
@GetMapping("/selectPartyOrganizationList") // @GetMapping("/selectPartyOrganizationList")
@ApiOperation(value = "党组织信息列表") // @ApiOperation(value = "党组织信息列表")
public AjaxResult selectPartyOrganizationList() { // public AjaxResult selectPartyOrganizationList() {
return partyOrganizationService.selectPartyOrganizationList(new Page<PartyOrganization>(getPageNum(), getPageSize())); // return partyOrganizationService.selectPartyOrganizationList(new Page<PartyOrganization>(getPageNum(), getPageSize()));
} // }
//
@PostMapping("/savePartyOrganization") // @PostMapping("/savePartyOrganization")
@ApiOperation(value = "新增党组织信息") // @ApiOperation(value = "新增党组织信息")
public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) { // public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) {
return partyOrganizationService.savePartyOrganization(partyOrganization); // return partyOrganizationService.savePartyOrganization(partyOrganization);
} // }
//
@PostMapping("/deletePartyOrganization") // @PostMapping("/deletePartyOrganization")
@ApiOperation(value = "删除党组织信息") // @ApiOperation(value = "删除党组织信息")
public AjaxResult deletePartyOrganization(@RequestBody IdsRequest id) { // public AjaxResult deletePartyOrganization(@RequestBody IdsRequest id) {
return partyOrganizationService.deletePartyOrganization(id); // return partyOrganizationService.deletePartyOrganization(id);
} // }
} }

View File

@ -15,6 +15,7 @@ import com.ydool.staff.request.PersonnelRequest;
import com.ydool.staff.request.PersonnelUpdateRequest; import com.ydool.staff.request.PersonnelUpdateRequest;
import com.ydool.staff.service.IAttachmentService; import com.ydool.staff.service.IAttachmentService;
import com.ydool.staff.service.IPersonnelService; import com.ydool.staff.service.IPersonnelService;
import com.ydool.system.request.IdsRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -89,4 +90,11 @@ public class PersonnelController extends BaseController {
public AjaxResult fileList(String id) { public AjaxResult fileList(String id) {
return attachmentService.fileList(new Page<Attachment>(getPageNum(), getPageSize()), id); return attachmentService.fileList(new Page<Attachment>(getPageNum(), getPageSize()), id);
} }
@PostMapping("/deleteFile")
@ApiOperation(value = "删除附件")
public AjaxResult deleteFile(@RequestBody IdsRequest ids){
return attachmentService.deleteFile(ids);
}
} }

View File

@ -10,6 +10,7 @@ import lombok.Data;
*/ */
@Data @Data
public class AttachmentDto { public class AttachmentDto {
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "名称")
private String name; private String name;
@ -18,4 +19,7 @@ public class AttachmentDto {
@ApiModelProperty(value = "大小") @ApiModelProperty(value = "大小")
private String size; private String size;
@ApiModelProperty(value = "后缀")
private String suffix;
} }

View File

@ -41,7 +41,6 @@ public class Attachment extends BaseEntity{
private String size; private String size;
@ApiModelProperty(value = "文件后缀") @ApiModelProperty(value = "文件后缀")
@TableField(exist = false)
private String suffix; private String suffix;
@ApiModelProperty(value = "附件状态0暂存 1已存") @ApiModelProperty(value = "附件状态0暂存 1已存")

View File

@ -1,10 +1,13 @@
package com.ydool.staff.entity; package com.ydool.staff.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.common.base.BaseEntity; import com.ydool.common.base.BaseEntity;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.ydool.staff.dto.AttachmentDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -95,9 +98,12 @@ public class DirectorsSupervisors extends BaseEntity {
private String remark; private String remark;
@ApiModelProperty(value = "相关附件") @ApiModelProperty(value = "相关附件")
@NotBlank(message = "相关附件不能为空")
private String correlationFile; private String correlationFile;
@ApiModelProperty(value = "单据状态") @ApiModelProperty(value = "单据状态")
private String documentStatus; private String documentStatus;
@ApiModelProperty(value = "附件")
@TableField(exist = false)
private List<AttachmentDto> attachmentDtoList;
} }

View File

@ -1,11 +1,16 @@
package com.ydool.staff.entity; package com.ydool.staff.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.common.base.BaseEntity; import com.ydool.common.base.BaseEntity;
import com.ydool.staff.request.AttachmentRequest;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; 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 java.util.List;
/** /**
* <p> * <p>
* 内设机构登记 * 内设机构登记
@ -23,8 +28,8 @@ public class Organization extends BaseEntity{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "企业名称") @ApiModelProperty(value = "企业Id")
private String companyName; private String companyId;
@ApiModelProperty(value = "信用代码") @ApiModelProperty(value = "信用代码")
private String creditCode; private String creditCode;
@ -35,4 +40,16 @@ public class Organization extends BaseEntity{
@ApiModelProperty(value = "相关附件") @ApiModelProperty(value = "相关附件")
private String attachment; private String attachment;
// @ApiModelProperty(value = "附件列表")
// @TableField(exist = false)
// private List<Attachment> attachments;
@ApiModelProperty(value = "企业名称")
@TableField(exist = false)
private String companyName;
@ApiModelProperty(value = "修改人")
@TableField(exist = false)
private String updatedName;
} }

View File

@ -26,9 +26,9 @@ 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不能为空") // @NotBlank(message = "企业Id不能为空")
private String organizationId; // private String organizationId;
@ApiModelProperty(value = "姓名") @ApiModelProperty(value = "姓名")
@NotBlank(message = "姓名不能为空") @NotBlank(message = "姓名不能为空")

View File

@ -0,0 +1,32 @@
package com.ydool.staff.request;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.Mechanism;
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 = "企业名称")
@NotBlank(message = "企业名称不能为空")
private String companyName;
@ApiModelProperty(value = "信用代码")
private String creditCode;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "附件列表")
private List<Attachment> attachments;
@ApiModelProperty(value = "机构信息")
@NotEmpty(message = "机构信息不能为空")
private List<Mechanism> mechments;
}

View File

@ -1,19 +1,40 @@
package com.ydool.staff.request; 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.Mechanism;
import com.ydool.staff.entity.Organization; import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.PartyOrganization;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
@Data @Data
public class OrganizationRequest implements Serializable { public class OrganizationRequest implements Serializable {
@ApiModelProperty(value = "机构") // @ApiModelProperty(value = "机构")
private Organization organization; // private Organization organization;
@ApiModelProperty(value = "企业Id")
private String companyId;
@ApiModelProperty(value = "信用代码")
private String creditCode;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "附件列表")
private List<AttachmentDto> attachments;
@ApiModelProperty(value = "机构信息") @ApiModelProperty(value = "机构信息")
private List<Mechanism> mechanismList; private List<Mechanism> mechanismList;
@ApiModelProperty(value = "党组织信息")
List<PartyOrganization> partyList;
} }

View File

@ -4,6 +4,7 @@ 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.Attachment; import com.ydool.staff.entity.Attachment;
import com.ydool.staff.request.AttachmentRequest; import com.ydool.staff.request.AttachmentRequest;
import com.ydool.system.request.IdsRequest;
/** /**
* <p> * <p>
@ -22,5 +23,9 @@ public interface IAttachmentService {
Attachment selectByIdAndPath(String id,String path); Attachment selectByIdAndPath(String id,String path);
AjaxResult fileList(Page<Attachment> page, String id); AjaxResult fileList(Page<Attachment> page, String id);
AjaxResult deleteFile(IdsRequest ids);
AjaxResult selectOrganizationFileList(String id);
} }

View File

@ -23,5 +23,7 @@ public interface IDirectorsSupervisorsService {
AjaxResult editDirectorsSupervisors(DirectorsSupervisors directorsSupervisors); AjaxResult editDirectorsSupervisors(DirectorsSupervisors directorsSupervisors);
AjaxResult deleteDirectorsSupervisors(IdsRequest ids); AjaxResult deleteDirectorsSupervisors(IdsRequest ids);
AjaxResult selectDirectorsSupervisorsById(String id);
} }

View File

@ -2,6 +2,8 @@ package com.ydool.staff.service;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Mechanism; import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.request.MechanismRequest;
import com.ydool.staff.request.OrganizationRequest;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
/** /**
@ -27,5 +29,7 @@ public interface IMechanismService {
* @return * @return
*/ */
AjaxResult deleteMechanism(IdsRequest id); AjaxResult deleteMechanism(IdsRequest id);
AjaxResult saveOrganizationMechanism(MechanismRequest mechanismRequest);
} }

View File

@ -1,6 +1,7 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -10,8 +11,12 @@ import com.ydool.staff.entity.Attachment;
import com.ydool.staff.mapper.AttachmentMapper; import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.service.IAttachmentService; import com.ydool.staff.service.IAttachmentService;
import com.ydool.system.mapper.UserMapper; import com.ydool.system.mapper.UserMapper;
import com.ydool.system.request.IdsRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
/** /**
@ -37,8 +42,8 @@ public class AttachmentServiceImpl extends BaseService<AttachmentMapper, Attachm
} }
@Override @Override
public boolean deleteById(String targetType,String id) { public boolean deleteById(String targetType, String id) {
return remove(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetType,targetType).eq(Attachment::getTargetId,id)); return remove(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetType, targetType).eq(Attachment::getTargetId, id));
} }
@Override @Override
@ -57,5 +62,25 @@ public class AttachmentServiceImpl extends BaseService<AttachmentMapper, Attachm
} }
return AjaxResult.ok().data(attachmentPage); return AjaxResult.ok().data(attachmentPage);
} }
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult deleteFile(IdsRequest id) {
if (CollectionUtil.isEmpty(Arrays.asList(id.getIds()))) {
return AjaxResult.fail().msg("Id不能为空");
} else {
int i = attachmentMapper.deleteBatchIds(Arrays.asList(id.getIds()));
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
}
}
@Override
public AjaxResult selectOrganizationFileList(String id) {
LambdaQueryWrapper<Attachment> attachmentLambdaQueryWrapper = new LambdaQueryWrapper<>();
attachmentLambdaQueryWrapper.eq(Attachment::getTargetId, id);
attachmentLambdaQueryWrapper.eq(Attachment::getTargetType, "organization");
Page<Attachment> attachmentPage = attachmentMapper.selectPage(new Page<>(), attachmentLambdaQueryWrapper);
return AjaxResult.ok().data(attachmentPage);
}
} }

View File

@ -37,10 +37,8 @@ public class CompanyNameServiceImpl extends BaseService<CompanyNameMapper, Compa
} }
@Override @Override
public AjaxResult companyName(String companyName) { public AjaxResult companyName(String id) {
LambdaQueryWrapper<CompanyName> companyNameLambdaQueryWrapper = new LambdaQueryWrapper<>(); return AjaxResult.ok().data(companyNameMapper.selectOne(new LambdaQueryWrapper<CompanyName>().eq(CompanyName::getId, id)));
companyNameLambdaQueryWrapper.eq(CompanyName::getCompanyName, companyName);
return AjaxResult.ok().data(companyNameMapper.selectOne(companyNameLambdaQueryWrapper));
} }
@Override @Override

View File

@ -1,21 +1,28 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.dto.AttachmentDto;
import com.ydool.staff.dto.DirectorsSupervisorsDto; import com.ydool.staff.dto.DirectorsSupervisorsDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.DirectorsSupervisors; import com.ydool.staff.entity.DirectorsSupervisors;
import com.ydool.common.base.BaseService; import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.mapper.DirectorsSupervisorsMapper; import com.ydool.staff.mapper.DirectorsSupervisorsMapper;
import com.ydool.staff.service.IDirectorsSupervisorsService; import com.ydool.staff.service.IDirectorsSupervisorsService;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.util.StringUtils;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
* <p> * <p>
@ -30,6 +37,8 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
@Autowired @Autowired
DirectorsSupervisorsMapper directorsSupervisorsMapper; DirectorsSupervisorsMapper directorsSupervisorsMapper;
@Autowired
AttachmentMapper attachmentMapper;
@Override @Override
public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) { public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) {
@ -46,8 +55,24 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult saveDirectorsSupervisors(DirectorsSupervisors directorsSupervisors) { public AjaxResult saveDirectorsSupervisors(DirectorsSupervisors directorsSupervisors) {
List<String> list = new ArrayList<>();
List<AttachmentDto> attachmentList = directorsSupervisors.getAttachmentDtoList();
for (AttachmentDto attachment : attachmentList) {
list.add(attachment.getPath());
}
directorsSupervisors.setCorrelationFile(StringUtils.join(list,","));
int i = directorsSupervisorsMapper.insert(directorsSupervisors); int i = directorsSupervisorsMapper.insert(directorsSupervisors);
return i > 0 ? AjaxResult.ok().msg("新增成功!") : AjaxResult.fail().msg("新增失败!"); if (i > 0) {
List<AttachmentDto> attachmentDtoList = directorsSupervisors.getAttachmentDtoList();
List<Attachment> attachments = BeanUtil.copyToList(attachmentDtoList, Attachment.class);
for (Attachment attachment : attachments) {
attachment.setTargetId(directorsSupervisors.getId());
attachment.setTargetType("directors");
attachmentMapper.insert(attachment);
}
return AjaxResult.ok().msg("新增成功!");
}
return AjaxResult.fail().msg("新增失败!");
} }
@Override @Override
@ -67,5 +92,14 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!"); return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
} }
} }
@Override
public AjaxResult selectDirectorsSupervisorsById(String id) {
DirectorsSupervisors directorsSupervisors = directorsSupervisorsMapper.selectById(id);
List<Attachment> attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, directorsSupervisors.getId()).eq(Attachment::getTargetType, "directors"));
List<AttachmentDto> attachmentDtos = BeanUtil.copyToList(attachmentList, AttachmentDto.class);
directorsSupervisors.setAttachmentDtoList(attachmentDtos);
return AjaxResult.ok().data(directorsSupervisors);
}
} }

View File

@ -65,7 +65,7 @@ public class ExchangeServiceImpl extends BaseService<ExchangeMapper, Exchange> i
User user = userMapper.selectById((String)StpUtil.getLoginId()); User user = userMapper.selectById((String)StpUtil.getLoginId());
dto.setUserName(personnel.getUserName()); dto.setUserName(personnel.getUserName());
dto.setOriginalCompanyName(personnel.getCompanyName()); dto.setOriginalCompanyName(personnel.getCompanyName());
dto.setWillCompanyName(organization.getCompanyName()); // dto.setWillCompanyName(organization.getCompanyName());
dto.setCardId(personnel.getNumberId()); dto.setCardId(personnel.getNumberId());
dto.setNowDept(personnel.getPresentDept()); dto.setNowDept(personnel.getPresentDept());
dto.setNowPosition(personnel.getPosition()); dto.setNowPosition(personnel.getPosition());

View File

@ -1,18 +1,29 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.Mechanism; import com.ydool.staff.entity.Mechanism;
import com.ydool.common.base.BaseService; import com.ydool.common.base.BaseService;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.mapper.MechanismMapper; import com.ydool.staff.mapper.MechanismMapper;
import com.ydool.staff.mapper.OrganizationMapper;
import com.ydool.staff.request.AttachmentRequest;
import com.ydool.staff.request.MechanismRequest;
import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.service.IMechanismService; import com.ydool.staff.service.IMechanismService;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.util.StringUtils;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
* <p> * <p>
@ -27,6 +38,10 @@ public class MechanismServiceImpl extends BaseService<MechanismMapper, Mechanism
@Autowired @Autowired
MechanismMapper mechanismMapper; MechanismMapper mechanismMapper;
@Autowired
OrganizationMapper organizationMapper;
@Autowired
AttachmentMapper attachmentMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -45,5 +60,38 @@ public class MechanismServiceImpl extends BaseService<MechanismMapper, Mechanism
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!"); return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
} }
} }
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult saveOrganizationMechanism(MechanismRequest mechanismRequest) {
Organization organization = new Organization();
List<String> list = new ArrayList<>();
List<Attachment> attachmentList = mechanismRequest.getAttachments();
for (Attachment attachment : attachmentList) {
list.add(attachment.getPath());
}
organization.setAttachment(StringUtils.join(list,","));
organization.setCreditCode(mechanismRequest.getCreditCode());
organization.setCompanyId(mechanismRequest.getCompanyName());
organization.setRemark(mechanismRequest.getRemark());
int i = organizationMapper.insert(organization);
if (i > 0) {
List<Attachment> attachments = mechanismRequest.getAttachments();
for (Attachment attachment : attachments) {
attachment.setTargetId(organization.getId());
attachment.setTargetType("organization");
attachment.setSize(attachment.getSize());
attachment.setSuffix(attachment.getSuffix());
attachmentMapper.insert(attachment);
}
List<Mechanism> mechments = mechanismRequest.getMechments();
for (Mechanism mechment : mechments) {
mechment.setOrganizationId(organization.getId());
}
boolean batch = saveBatch(mechments);
return batch ? AjaxResult.ok().msg("新增成功!") : AjaxResult.fail().msg("新增失败!");
}
return AjaxResult.fail().msg("新增失败!");
}
} }

View File

@ -1,16 +1,16 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.Mechanism; import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.entity.Organization; import com.ydool.staff.entity.*;
import com.ydool.common.base.BaseService; import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.MechanismMapper; import com.ydool.staff.mapper.*;
import com.ydool.staff.mapper.OrganizationMapper;
import com.ydool.staff.request.OrganizationRequest; import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.service.IOrganizationService; import com.ydool.staff.service.IOrganizationService;
import com.ydool.system.mapper.UserMapper; import com.ydool.system.mapper.UserMapper;
@ -18,7 +18,9 @@ import com.ydool.system.request.IdsRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.util.StringUtils;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -36,18 +38,25 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
@Autowired @Autowired
OrganizationMapper organizationMapper; OrganizationMapper organizationMapper;
@Autowired @Autowired
PartyOrganizationMapper partyOrganizationMapper;
@Autowired
MechanismMapper mechanismMapper; MechanismMapper mechanismMapper;
@Autowired @Autowired
CompanyNameMapper companyNameMapper;
@Autowired
UserMapper userMapper; UserMapper userMapper;
@Autowired
AttachmentMapper attachmentMapper;
@Override @Override
public AjaxResult selectOrganizationList(Page<Organization> page, String companyName) { public AjaxResult selectOrganizationList(Page<Organization> page, String companyName) {
LambdaQueryWrapper<Organization> organizationLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Organization> organizationLambdaQueryWrapper = new LambdaQueryWrapper<>();
organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(companyName), Organization::getCompanyName, companyName); organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(companyName), Organization::getCompanyName, companyName);
Page<Organization> selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper); Page<Organization> selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper);
// for (Organization record : selectPage.getRecords()) { for (Organization record : selectPage.getRecords()) {
// record.setUpdatedId(userMapper.selectById(record.getUpdatedId()).getUserName()); record.setUpdatedName(userMapper.selectById(record.getUpdatedId()).getUserName());
// } record.setCompanyName(companyNameMapper.selectById(record.getCompanyId()).getCompanyName());
}
return AjaxResult.ok().data(selectPage); return AjaxResult.ok().data(selectPage);
} }
@ -58,8 +67,15 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
return AjaxResult.fail().msg("未找到相关信息!"); return AjaxResult.fail().msg("未找到相关信息!");
} else { } else {
List<Mechanism> mechanismList = mechanismMapper.selectList(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, organization.getId())); List<Mechanism> mechanismList = mechanismMapper.selectList(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, organization.getId()));
List<Attachment> attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, organization.getId()).eq(Attachment::getTargetType, "organization"));
List<PartyOrganization> partyOrganizationList = partyOrganizationMapper.selectList(new LambdaQueryWrapper<PartyOrganization>());
List<AttachmentDto> toList = BeanUtil.copyToList(attachmentList, AttachmentDto.class);
OrganizationRequest organizationRequest = new OrganizationRequest(); OrganizationRequest organizationRequest = new OrganizationRequest();
organizationRequest.setOrganization(organization); organizationRequest.setRemark(organization.getRemark());
organizationRequest.setCreditCode(organization.getCreditCode());
organizationRequest.setCompanyId(companyNameMapper.selectById(organization.getCompanyId()).getCompanyName());
organizationRequest.setAttachments(toList);
organizationRequest.setPartyList(partyOrganizationList);
organizationRequest.setMechanismList(mechanismList); organizationRequest.setMechanismList(mechanismList);
return AjaxResult.ok().data(organizationRequest); return AjaxResult.ok().data(organizationRequest);
} }
@ -78,7 +94,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
@Override @Override
public AjaxResult selectOrganizationByName(String companyName) { public AjaxResult selectOrganizationByName(String companyName) {
return AjaxResult.ok().data(organizationMapper.selectOne(new LambdaQueryWrapper<Organization>().eq(Organization::getCompanyName, companyName))); return AjaxResult.ok().data(companyNameMapper.selectOne(new LambdaQueryWrapper<CompanyName>().eq(CompanyName::getId, companyName)));
} }
@Override @Override

View File

@ -19,6 +19,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@RestController @RestController
@RequestMapping(value = UrlConstant.ATTACHMENT) @RequestMapping(value = UrlConstant.ATTACHMENT)
@Api(tags = "文件上传", value = "文件上传") @Api(tags = "文件上传", value = "文件上传")
@ -36,7 +37,7 @@ public class UploadController {
return AjaxResult.fail("不能上传后缀为" + suffix + "的文件"); return AjaxResult.fail("不能上传后缀为" + suffix + "的文件");
} }
String path = UploadUtils.uploadFile(file); String path = UploadUtils.uploadFile(file);
Dict data = Dict.create().set("path", path).set("name", file.getOriginalFilename()); Dict data = Dict.create().set("path", path).set("name", file.getOriginalFilename()).set("size", file.getSize()).set("suffix", FileUtil.getSuffix(file.getOriginalFilename()).toUpperCase());
return AjaxResult.ok().data(data); return AjaxResult.ok().data(data);
} }
@ -52,7 +53,7 @@ public class UploadController {
return AjaxResult.fail("不能上传后缀为" + suffix + "的文件"); return AjaxResult.fail("不能上传后缀为" + suffix + "的文件");
} }
String path = UploadUtils.uploadFile(file); String path = UploadUtils.uploadFile(file);
list.add(Dict.create().set("path", path).set("name", file.getOriginalFilename())); list.add(Dict.create().set("path", path).set("name", file.getOriginalFilename()).set("size", file.getSize()).set("suffix", FileUtil.getSuffix(file.getOriginalFilename()).toUpperCase()));
} }
return CollectionUtil.isNotEmpty(list) ? AjaxResult.ok("data", list) : AjaxResult.fail().msg("上传失败!!!"); return CollectionUtil.isNotEmpty(list) ? AjaxResult.ok("data", list) : AjaxResult.fail().msg("上传失败!!!");
} }