Merge remote-tracking branch 'origin/master'

This commit is contained in:
lijiaqi 2023-02-09 10:53:21 +08:00
commit 7d6aacc3f3
36 changed files with 893 additions and 179 deletions

View File

@ -0,0 +1,46 @@
package com.ydool.common.constant;
/**
* @author msh
* @version 1.0
* @date 2023/2/8 11:04
*/
public class AgesConst {
/**
*身份证附件
*/
public static final String CARD_FILE = "card";
/**
* 聘任证书附件
*/
public static final String ENGAGE_FILE = "engage";
/**
* 职称证书附件
*/
public static final String JOBTITLE_FILE = "jobtitle";
/**
* 学历证书附件
*/
public static final String EDUCATION_FILE = "education";
/**
* 审批资料附件
*/
public static final String AUDIT_FILE = "audit";
/**
* 新增类型参数
*/
public static final String SAVE = "save";
/**
* 修改类型参数
*/
public static final String UPDATE = "update";
/**
* 附件所属变更
*/
public static final String CHANGE = "Change";
/**
* 附件所属人员
*/
public static final String PERSONNEL = "personnel";
}

View File

@ -39,6 +39,7 @@ public interface UrlConstant {
String ORGANIZATION = API + "/organization";
String PARTY_ORGANIZATION = API + "/party_organization";
String DIRECTORS_SUPERVISORS = API + "/directors_supervisors";
String ALTERATION = API + "/alteration";

View File

@ -0,0 +1,117 @@
package com.ydool.common.utils;
import java.io.Serializable;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.function.Function;
/**
* Java8通过Function函数获取字段名称(获取实体类的字段名称)
* @see
* @author jx
*/
public class ColumnUtil {
/**
* 使Function获取序列化能力
*/
@FunctionalInterface
public interface SFunction<T, R> extends Function<T, R>, Serializable {}
/**
* 字段名注解,声明表字段
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface TableField {
String value() default "";
}
//默认配置
static String defaultSplit = "";
static Integer defaultToType = 0;
/**
* 获取实体类的字段名称(实体声明的字段名称)
*/
public static <T> String getFieldName(SFunction<T, ?> fn) {
return getFieldName(fn, defaultSplit);
}
/**
* 获取实体类的字段名称
* @param split 分隔符多个字母自定义分隔符
*/
public static <T> String getFieldName(SFunction<T, ?> fn, String split) {
return getFieldName(fn, split, defaultToType);
}
/**
* 获取实体类的字段名称
*
* @param split 分隔符多个字母自定义分隔符
* @param toType 转换方式多个字母以大小写方式返回 0.不做转换 1.大写 2.小写
*/
public static <T> String getFieldName(SFunction<T, ?> fn, String split, Integer toType) {
SerializedLambda serializedLambda = getSerializedLambda(fn);
// 从lambda信息取出methodfieldclass等
String fieldName = serializedLambda.getImplMethodName().substring("get".length());
fieldName = fieldName.replaceFirst(fieldName.charAt(0) + "", (fieldName.charAt(0) + "").toLowerCase());
Field field;
try {
field = Class.forName(serializedLambda.getImplClass().replace("/", ".")).getDeclaredField(fieldName);
} catch (ClassNotFoundException | NoSuchFieldException e) {
throw new RuntimeException(e);
}
// 从field取出字段名可以根据实际情况调整
TableField tableField = field.getAnnotation(TableField.class);
if (tableField != null && tableField.value().length() > 0) {
return tableField.value();
} else {
//0.不做转换 1.大写 2.小写
switch (toType) {
case 1:
return fieldName.replaceAll("[A-Z]", split + "$0").toUpperCase();
case 2:
return fieldName.replaceAll("[A-Z]", split + "$0").toLowerCase();
default:
return fieldName.replaceAll("[A-Z]", split + "$0");
}
}
}
private static <T> SerializedLambda getSerializedLambda(SFunction<T, ?> fn) {
// 从function取出序列化方法
Method writeReplaceMethod;
try {
writeReplaceMethod = fn.getClass().getDeclaredMethod("writeReplace");
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
}
// 从序列化方法取出序列化的lambda信息
boolean isAccessible = writeReplaceMethod.isAccessible();
writeReplaceMethod.setAccessible(true);
SerializedLambda serializedLambda;
try {
serializedLambda = (SerializedLambda) writeReplaceMethod.invoke(fn);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
writeReplaceMethod.setAccessible(isAccessible);
return serializedLambda;
}
}

View File

@ -0,0 +1,40 @@
package com.ydool.staff.controller;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.ydool.common.base.BaseController;
import com.ydool.common.constant.UrlConstant;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.PersonnelDto;
import com.ydool.staff.service.IAlterationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author msh
* @version 1.0
* @date 2023/2/7 17:04
*/
@RestController
@RequestMapping(UrlConstant.ALTERATION)
@Api(tags = "变更记录", value = "变更记录")
@ApiSupport(order = 9)
public class AlterationController extends BaseController {
@Resource
private IAlterationService alterationService;
@GetMapping( "alterationPage")
@ApiOperation(value = "变更记录列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "员工id")})
public AjaxResult alterationPage(String id){
return alterationService.alterationList(id);
}
}

View File

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

View File

@ -31,6 +31,13 @@ public class DirectorsSupervisorsController extends BaseController {
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")
@ApiOperation(value = "新增董监任免申报")
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.*;
@RestController
@RequestMapping(UrlConstant.MECHANISM)
@Api(tags = "机构信息", value = "机构信息")
// @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);
}
// @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);
// }
}

View File

@ -1,16 +1,22 @@
package com.ydool.staff.controller;
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.constant.UrlConstant;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
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
@ -18,39 +24,110 @@ import org.springframework.web.bind.annotation.*;
@Api(tags = "内设机构登记", value = "内设机构登记")
public class OrganizationController extends BaseController {
@Autowired
ICompanyNameService companyNameService;
@Autowired
IOrganizationService organizationService;
@Autowired
IPartyOrganizationService partyOrganizationService;
@Autowired
IMechanismService mechanismService;
@Autowired
IAttachmentService attachmentService;
@GetMapping("/selectOrganization")
@ApiOperation(value = "企业名称列表")
public AjaxResult selectOrganization() {
return organizationService.selectOrganization();
}
// @GetMapping("/selectOrganization")
// @ApiOperation(value = "企业名称列表")
// @ApiOperationSupport(order = 1)
// 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)})
public AjaxResult selectOrganizationByName(String companyName) {
return organizationService.selectOrganizationByName(companyName);
}
/**
* =======================内设机构登记===========================
* @return
*/
@GetMapping("/selectOrganizationList")
@ApiOperation(value = "内设机构登记列表")
@ApiOperationSupport(order = 1)
@ApiImplicitParams({@ApiImplicitParam(name = "companyName", value = "企业名称"), @ApiImplicitParam(name = "current", value = "当前页", dataType = "Integer"), @ApiImplicitParam(name = "size", value = "每页条数", dataType = "Integer"),})
public AjaxResult selectOrganizationList(String 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")
@ApiOperation(value = "内设机构登记详情")
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "企业Id")})
@ApiOperationSupport(order = 4)
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "内设机构Id")})
public AjaxResult selectOrganizationByMechanism(String id) {
return organizationService.selectOrganizationByMechanism(id);
}
@PostMapping("/deleteOrganization")
@ApiOperation(value = "删除内设机构")
@ApiOperation(value = "内设机构删除")
@ApiOperationSupport(order = 5)
public AjaxResult deleteOrganization(@RequestBody IdsRequest 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.*;
@RestController
@RequestMapping(UrlConstant.PARTY_ORGANIZATION)
@Api(tags = "党组织信息", value = "党组织信息")
// @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<PartyOrganization>(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);
}
// @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 @Validated PartyOrganization partyOrganization) {
// return partyOrganizationService.savePartyOrganization(partyOrganization);
// }
//
// @PostMapping("/deletePartyOrganization")
// @ApiOperation(value = "删除党组织信息")
// public AjaxResult deletePartyOrganization(@RequestBody IdsRequest id) {
// return partyOrganizationService.deletePartyOrganization(id);
// }
}

View File

@ -8,12 +8,14 @@ import com.ydool.common.data.dto.AjaxResult;
import com.ydool.common.utils.UploadUtils;
import com.ydool.staff.dto.PersonnelDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.SelectRequest;
import com.ydool.staff.request.ChangeRequest;
import com.ydool.staff.request.PersonnelDeleteRequest;
import com.ydool.staff.request.PersonnelRequest;
import com.ydool.staff.request.PersonnelUpdateRequest;
import com.ydool.staff.service.IAttachmentService;
import com.ydool.staff.service.IPersonnelService;
import com.ydool.system.request.IdsRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -40,14 +42,15 @@ public class PersonnelController extends BaseController {
@Autowired
IAttachmentService attachmentService;
@GetMapping( "personnelList")
@PostMapping( "personnelList")
@ApiOperation(value = "人员列表,传id查一条",response = PersonnelDto.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "orderBy", value = "排序顺序 降序desc升序asc"),
@ApiImplicitParam(name = "column", value = "排序字段 字段名"),
@ApiImplicitParam(name = "current", value = "当前页"),
@ApiImplicitParam(name = "size", value = "每页条数"),
@ApiImplicitParam(name = "id", value = "人员id")})
public AjaxResult personnelList(String id){
return personnelService.personnelList(getPage(),id);
@ApiImplicitParam(name = "size", value = "每页条数")})
public AjaxResult personnelList(@RequestBody SelectRequest request, String orderBy,String column){
return personnelService.personnelList(getPage(),request,orderBy,column);
}
@PostMapping(value = "savePersonnel")
@ -72,6 +75,7 @@ public class PersonnelController extends BaseController {
return personnelService.updateChange(request);
}
@GetMapping("/download")
@ApiOperation(value = "下载文件")
@ApiImplicitParams({@ApiImplicitParam(name = "path", value = "文件路径"), @ApiImplicitParam(name = "fileName", value = "文件名")})
@ -86,4 +90,11 @@ public class PersonnelController extends BaseController {
public AjaxResult fileList(String 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

@ -0,0 +1,37 @@
package com.ydool.staff.dto;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @author msh
* @version 1.0
* @date 2023/2/7 17:11
*/
@Data
public class AlterationDto {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "变更前")
private String beforeChange;
@ApiModelProperty(value = "变更后")
private String afterChange;
@ApiModelProperty(value = "变更内容")
private String details;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@ApiModelProperty(value = "创建时间")
private LocalDateTime createdAt;
@ApiModelProperty(value = "变更人")
private String createdName;
}

View File

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

View File

@ -27,6 +27,9 @@ public class Alteration extends BaseEntity{
@ApiModelProperty(value = "关联id")
private String relevancyId;
@ApiModelProperty(value = "变更字段名称")
private String fieldName;
@ApiModelProperty(value = "变更前")
private String beforeChange;

View File

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

View File

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

View File

@ -1,11 +1,16 @@
package com.ydool.staff.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.common.base.BaseEntity;
import com.ydool.staff.request.AttachmentRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* <p>
* 内设机构登记
@ -23,8 +28,8 @@ public class Organization extends BaseEntity{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "企业名称")
private String companyName;
@ApiModelProperty(value = "企业Id")
private String companyId;
@ApiModelProperty(value = "信用代码")
private String creditCode;
@ -35,4 +40,16 @@ public class Organization extends BaseEntity{
@ApiModelProperty(value = "相关附件")
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;
@ApiModelProperty(value = "企业Id")
@NotBlank(message = "企业Id不能为空")
private String organizationId;
// @ApiModelProperty(value = "企业Id")
// @NotBlank(message = "企业Id不能为空")
// private String organizationId;
@ApiModelProperty(value = "姓名")
@NotBlank(message = "姓名不能为空")

View File

@ -32,12 +32,6 @@ public class Personnel extends BaseEntity {
private static final long serialVersionUID = 1L;
public static final String CARD_FILE = "card";
public static final String ENGAGE_FILE = "engage";
public static final String JOBTITLE_FILE = "jobtitle";
public static final String EDUCATION_FILE = "education";
public static final String AUDIT_FILE = "audit";
@ApiModelProperty(value = "统一社会信用代码")
private String socialCreditCode;
@ -155,4 +149,10 @@ public class Personnel extends BaseEntity {
@ApiModelProperty(value = "变更标志")
private String alterationSign;
@ApiModelProperty(value = "审批状态 0 未审批 1 待审批2已通过3已拒绝")
private Integer auditState;
@ApiModelProperty(value = "单据状态")
private String receipts;
}

View File

@ -0,0 +1,75 @@
package com.ydool.staff.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author msh
* @version 1.0
* @date 2023/2/8 13:55
*/
@Data
public class SelectRequest {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "文件名")
private String fileName;
@ApiModelProperty(value = "姓名")
private String userName;
@ApiModelProperty(value = "企业名称")
private String companyName;
@ApiModelProperty(value = "身份证号")
private String numberId;
@ApiModelProperty(value = "所在部门")
private String presentDept;
@ApiModelProperty(value = "政治面貌")
private String politicsStatus;
@ApiModelProperty(value = "录用方式")
private String hireType;
@ApiModelProperty(value = "岗位职务")
private String position;
@ApiModelProperty(value = "合同形式")
private String contractModality;
@ApiModelProperty(value = "执业资格证书")
private String qualification;
@ApiModelProperty(value = "专业技术职称")
private String jobTitle;
@ApiModelProperty(value = "人员类型")
private String personnelType;
@ApiModelProperty(value = "入职时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date hireDate;
@ApiModelProperty(value = "离职时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date resignationTime;
@ApiModelProperty(value = "工作状态")
private String workState;
@ApiModelProperty(value = "单据状态")
private String receipts;
@ApiModelProperty(value = "变更标志")
private String alterationSign;
}

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;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.PartyOrganization;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
@Data
public class OrganizationRequest implements Serializable {
@ApiModelProperty(value = "机构")
private Organization organization;
// @ApiModelProperty(value = "机构")
// 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 = "机构信息")
private List<Mechanism> mechanismList;
@ApiModelProperty(value = "党组织信息")
List<PartyOrganization> partyList;
}

View File

@ -35,7 +35,7 @@ public class PersonnelUpdateRequest {
@ApiModelProperty(value = "是否应届毕业生")
@NotBlank(message = "是否应届毕业生不能为空")
private Boolean freshGraduate;
private Integer freshGraduate;
@ApiModelProperty(value = "毕业院校")
@NotBlank(message = "毕业院校不能为空")

View File

@ -1,5 +1,8 @@
package com.ydool.staff.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult;
/**
* <p>
* 变更记录表 服务类
@ -10,5 +13,7 @@ package com.ydool.staff.service;
*/
public interface IAlterationService {
AjaxResult alterationList(String id);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.request.AttachmentRequest;
import com.ydool.system.request.IdsRequest;
/**
* <p>
@ -22,5 +23,9 @@ public interface IAttachmentService {
Attachment selectByIdAndPath(String id,String path);
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 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.staff.entity.Mechanism;
import com.ydool.staff.request.MechanismRequest;
import com.ydool.staff.request.OrganizationRequest;
import com.ydool.system.request.IdsRequest;
/**
@ -27,5 +29,7 @@ public interface IMechanismService {
* @return
*/
AjaxResult deleteMechanism(IdsRequest id);
AjaxResult saveOrganizationMechanism(MechanismRequest mechanismRequest);
}

View File

@ -2,6 +2,7 @@ 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.SelectRequest;
import com.ydool.staff.request.ChangeRequest;
import com.ydool.staff.request.PersonnelDeleteRequest;
import com.ydool.staff.request.PersonnelRequest;
@ -22,7 +23,7 @@ public interface IPersonnelService {
* 人员列表
* @return
*/
AjaxResult personnelList(Page page , String id);
AjaxResult personnelList(Page page , SelectRequest request, String orderBy,String column);
AjaxResult personnelByExchangeList();

View File

@ -1,11 +1,26 @@
package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.base.BaseService;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.AlterationDto;
import com.ydool.staff.dto.PersonnelDto;
import com.ydool.staff.entity.Alteration;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.Personnel;
import com.ydool.staff.mapper.AlterationMapper;
import com.ydool.staff.service.IAlterationService;
import com.ydool.system.entity.Dept;
import com.ydool.system.entity.User;
import com.ydool.system.mapper.UserMapper;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 变更记录表 服务类
@ -17,5 +32,19 @@ import org.springframework.stereotype.Service;
@Service
public class AlterationServiceImpl extends BaseService<AlterationMapper, Alteration> implements IAlterationService {
@Override
public AjaxResult alterationList(String id) {
List<Alteration> list = list(new LambdaQueryWrapper<Alteration>().eq(Alteration::getRelevancyId, id));
List<AlterationDto> alterationDtos = BeanUtil.copyToList(list, AlterationDto.class);
for (Alteration dto : list) {
UserMapper userMapper = SpringUtil.getBean(UserMapper.class);
User user = userMapper.selectById(dto.getCreatedId());
for (AlterationDto alterationDto : alterationDtos) {
alterationDto.setCreatedName(user.getUserName());
}
}
return AjaxResult.ok().data(alterationDtos);
}
}

View File

@ -1,6 +1,7 @@
package com.ydool.staff.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.service.IAttachmentService;
import com.ydool.system.mapper.UserMapper;
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 java.util.Arrays;
/**
@ -37,8 +42,8 @@ public class AttachmentServiceImpl extends BaseService<AttachmentMapper, Attachm
}
@Override
public boolean deleteById(String targetType,String id) {
return remove(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetType,targetType).eq(Attachment::getTargetId,id));
public boolean deleteById(String targetType, String id) {
return remove(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetType, targetType).eq(Attachment::getTargetId, id));
}
@Override
@ -57,5 +62,25 @@ public class AttachmentServiceImpl extends BaseService<AttachmentMapper, Attachm
}
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
public AjaxResult companyName(String companyName) {
LambdaQueryWrapper<CompanyName> companyNameLambdaQueryWrapper = new LambdaQueryWrapper<>();
companyNameLambdaQueryWrapper.eq(CompanyName::getCompanyName, companyName);
return AjaxResult.ok().data(companyNameMapper.selectOne(companyNameLambdaQueryWrapper));
public AjaxResult companyName(String id) {
return AjaxResult.ok().data(companyNameMapper.selectOne(new LambdaQueryWrapper<CompanyName>().eq(CompanyName::getId, id)));
}
@Override

View File

@ -1,21 +1,28 @@
package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
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.data.dto.AjaxResult;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.dto.DirectorsSupervisorsDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.DirectorsSupervisors;
import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.mapper.DirectorsSupervisorsMapper;
import com.ydool.staff.service.IDirectorsSupervisorsService;
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;
/**
* <p>
@ -30,6 +37,8 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
@Autowired
DirectorsSupervisorsMapper directorsSupervisorsMapper;
@Autowired
AttachmentMapper attachmentMapper;
@Override
public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) {
@ -46,8 +55,24 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
@Override
@Transactional(rollbackFor = Exception.class)
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);
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
@ -67,5 +92,14 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
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());
dto.setUserName(personnel.getUserName());
dto.setOriginalCompanyName(personnel.getCompanyName());
dto.setWillCompanyName(organization.getCompanyName());
// dto.setWillCompanyName(organization.getCompanyName());
dto.setCardId(personnel.getNumberId());
dto.setNowDept(personnel.getPresentDept());
dto.setNowPosition(personnel.getPosition());

View File

@ -1,18 +1,29 @@
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 com.ydool.common.data.dto.AjaxResult;
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.mapper.AttachmentMapper;
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.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;
/**
* <p>
@ -27,6 +38,10 @@ public class MechanismServiceImpl extends BaseService<MechanismMapper, Mechanism
@Autowired
MechanismMapper mechanismMapper;
@Autowired
OrganizationMapper organizationMapper;
@Autowired
AttachmentMapper attachmentMapper;
@Override
@Transactional(rollbackFor = Exception.class)
@ -45,5 +60,38 @@ public class MechanismServiceImpl extends BaseService<MechanismMapper, Mechanism
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;
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.data.dto.AjaxResult;
import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.entity.*;
import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.MechanismMapper;
import com.ydool.staff.mapper.OrganizationMapper;
import com.ydool.staff.mapper.*;
import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.service.IOrganizationService;
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.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;
@ -36,18 +38,25 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
@Autowired
OrganizationMapper organizationMapper;
@Autowired
PartyOrganizationMapper partyOrganizationMapper;
@Autowired
MechanismMapper mechanismMapper;
@Autowired
CompanyNameMapper companyNameMapper;
@Autowired
UserMapper userMapper;
@Autowired
AttachmentMapper attachmentMapper;
@Override
public AjaxResult selectOrganizationList(Page<Organization> page, String companyName) {
LambdaQueryWrapper<Organization> organizationLambdaQueryWrapper = new LambdaQueryWrapper<>();
organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(companyName), Organization::getCompanyName, companyName);
Page<Organization> selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper);
// for (Organization record : selectPage.getRecords()) {
// record.setUpdatedId(userMapper.selectById(record.getUpdatedId()).getUserName());
// }
for (Organization record : selectPage.getRecords()) {
record.setUpdatedName(userMapper.selectById(record.getUpdatedId()).getUserName());
record.setCompanyName(companyNameMapper.selectById(record.getCompanyId()).getCompanyName());
}
return AjaxResult.ok().data(selectPage);
}
@ -58,8 +67,15 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
return AjaxResult.fail().msg("未找到相关信息!");
} else {
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.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);
return AjaxResult.ok().data(organizationRequest);
}
@ -78,7 +94,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
@Override
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

View File

@ -1,22 +1,29 @@
package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollStreamUtil;
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.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.base.BaseService;
import com.ydool.common.constant.AgesConst;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.common.utils.ColumnUtil;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.dto.PersonnelByExchangeDto;
import com.ydool.staff.dto.PersonnelDto;
import com.ydool.staff.dto.PersonnelUpdateDto;
import com.ydool.staff.entity.Alteration;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.Personnel;
import com.ydool.staff.entity.SelectRequest;
import com.ydool.staff.mapper.AlterationMapper;
import com.ydool.staff.mapper.CompanyNameMapper;
import com.ydool.staff.mapper.OrganizationMapper;
import com.ydool.staff.mapper.PersonnelMapper;
import com.ydool.staff.request.AttachmentRequest;
@ -28,6 +35,7 @@ import com.ydool.staff.service.IAttachmentService;
import com.ydool.staff.service.IPersonnelService;
import com.ydool.system.entity.Dept;
import com.ydool.system.mapper.DeptMapper;
import org.apache.poi.ss.formula.functions.Column;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.util.StringUtils;
@ -58,7 +66,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
@Resource
private AlterationMapper alterationMapper;
@Resource
private OrganizationMapper organizationMapper;
private CompanyNameMapper companyNameMapper;
@Resource
private DeptMapper deptMapper;
@ -68,9 +76,9 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
* @return
*/
@Override
public AjaxResult personnelList(Page page , String id) {
if (ObjectUtil.isNotNull(id)){
Personnel personnel = personnelMapper.selectById(id);
public AjaxResult personnelList(Page page , SelectRequest request, String orderBy,String column) {
if (StrUtil.isNotBlank(request.getId())){
Personnel personnel = personnelMapper.selectById(request.getId());
PersonnelUpdateDto personnelUpdateDto = BeanUtil.copyProperties(personnel, PersonnelUpdateDto.class);
personnelUpdateDto.setCardFiles(nameAndPath(personnel.getCardFile(), personnel.getId()));
personnelUpdateDto.setEngageFiles(nameAndPath(personnel.getEngageFile(), personnel.getId()));
@ -79,14 +87,16 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
personnelUpdateDto.setAuditFiles(nameAndPath(personnel.getAuditFile(), personnel.getId()));
return AjaxResult.ok().data(personnelUpdateDto);
}
Page personnelPage = page(page, new LambdaQueryWrapper<>());
QueryWrapper wrapper = selectWrapper(request, orderBy, column);
Page personnelPage = page(page, wrapper);
List<Personnel> list = personnelPage.getRecords();
personnelPage.setRecords(list.stream().map(e->{
PersonnelDto dto = BeanUtil.copyProperties(e, PersonnelDto.class);
Organization organization = organizationMapper.selectById(e.getCompanyName());
CompanyName companyName = companyNameMapper.selectById(e.getCompanyName());
Dept dept = deptMapper.selectById(e.getPresentDept());
dto.setPresentDept(dept.getName());
dto.setCompanyName(organization.getCompanyName());
dto.setCompanyName(companyName.getCompanyName());
dto.setCreatedAt(e.getCreatedAt());
return dto;
}).collect(Collectors.toList()));
@ -110,17 +120,17 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
@Transactional(rollbackFor = Exception.class)
public AjaxResult savePersonnel(PersonnelRequest personnelRequest) {
Personnel personnel = BeanUtil.copyProperties(personnelRequest, Personnel.class);
personnel.setCardFile(StringUtils.join(saveFilePath(personnelRequest.getCardFile(),Personnel.CARD_FILE,"",""),','));
personnel.setEngageFile(StringUtils.join(saveFilePath(personnelRequest.getEngageFile(),Personnel.ENGAGE_FILE,"",""),','));
personnel.setJobTitleFile(StringUtils.join(saveFilePath(personnelRequest.getJobTitleFile(),Personnel.EDUCATION_FILE,"",""),','));
personnel.setEducationFile(StringUtils.join(saveFilePath(personnelRequest.getEducationFile(),Personnel.JOBTITLE_FILE,"",""),','));
personnel.setAuditFile(StringUtils.join(saveFilePath(personnelRequest.getAuditFile(),Personnel.AUDIT_FILE,"",""),','));
personnel.setCardFile(StringUtils.join(saveFilePath(personnelRequest.getCardFile(),AgesConst.CARD_FILE,AgesConst.SAVE,""),','));
personnel.setEngageFile(StringUtils.join(saveFilePath(personnelRequest.getEngageFile(),AgesConst.ENGAGE_FILE,AgesConst.SAVE,""),','));
personnel.setJobTitleFile(StringUtils.join(saveFilePath(personnelRequest.getJobTitleFile(),AgesConst.EDUCATION_FILE,AgesConst.SAVE,""),','));
personnel.setEducationFile(StringUtils.join(saveFilePath(personnelRequest.getEducationFile(),AgesConst.JOBTITLE_FILE,AgesConst.SAVE,""),','));
personnel.setAuditFile(StringUtils.join(saveFilePath(personnelRequest.getAuditFile(),AgesConst.AUDIT_FILE,AgesConst.SAVE,""),','));
boolean save = save(personnel);
saveAttachment(personnelRequest.getCardFile(),Personnel.CARD_FILE,personnel.getId());
saveAttachment(personnelRequest.getEngageFile(),Personnel.ENGAGE_FILE,personnel.getId());
saveAttachment(personnelRequest.getEducationFile(),Personnel.EDUCATION_FILE,personnel.getId());
saveAttachment(personnelRequest.getJobTitleFile(),Personnel.JOBTITLE_FILE,personnel.getId());
saveAttachment(personnelRequest.getAuditFile(),Personnel.AUDIT_FILE,personnel.getId());
saveAttachment(personnelRequest.getCardFile(),AgesConst.CARD_FILE,personnel.getId(),AgesConst.SAVE);
saveAttachment(personnelRequest.getEngageFile(),AgesConst.ENGAGE_FILE,personnel.getId(),AgesConst.SAVE);
saveAttachment(personnelRequest.getEducationFile(),AgesConst.EDUCATION_FILE,personnel.getId(),AgesConst.SAVE);
saveAttachment(personnelRequest.getJobTitleFile(),AgesConst.JOBTITLE_FILE,personnel.getId(),AgesConst.SAVE);
saveAttachment(personnelRequest.getAuditFile(),AgesConst.AUDIT_FILE,personnel.getId(),AgesConst.SAVE);
return save ? AjaxResult.ok().msg("保存成功!"):AjaxResult.fail().msg("保存失败!");
}
@ -143,73 +153,74 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
@Transactional(rollbackFor = Exception.class)
public AjaxResult updatePersonnel(PersonnelUpdateRequest updateRequest) {
Personnel per = get(updateRequest.getId());
Personnel personnel = BeanUtil.copyProperties(updateRequest, Personnel.class);
List<AttachmentRequest> cardFile = updateRequest.getCardFile();
List<AttachmentRequest> educationFile = updateRequest.getEducationFile();
List<AttachmentRequest> auditFile = updateRequest.getAuditFile();
personnel.setCardFile(StringUtils.join(saveFilePath(cardFile,Personnel.CARD_FILE,"update",personnel.getId()),','));
personnel.setEducationFile(StringUtils.join(saveFilePath(educationFile,Personnel.EDUCATION_FILE,"update",personnel.getId()),','));
personnel.setAuditFile(StringUtils.join(saveFilePath(auditFile,Personnel.AUDIT_FILE,"update",personnel.getId()),','));
boolean update = updateById(personnel);
String type ="personnel";
if (update){
saveAlteration("民族更改",per.getNation(),updateRequest.getNation(),type,updateRequest.getId());
saveAlteration("政治面貌更改",per.getPoliticsStatus(),updateRequest.getPoliticsStatus(),type,updateRequest.getId());
saveAlteration("学历更改",per.getEducation(),updateRequest.getEducation(),type,updateRequest.getId());
saveAlteration("是否应届毕业生更改",per.getFreshGraduate(),updateRequest.getFreshGraduate(),type,updateRequest.getId());
saveAlteration("毕业院校更改",per.getAcademy(),updateRequest.getAcademy(),type,updateRequest.getId());
saveAlteration("专业更改",per.getSpecialty(),updateRequest.getSpecialty(),type,updateRequest.getId());
saveAlteration("所在部门更改",per.getPresentDept(),updateRequest.getPresentDept(),type,updateRequest.getId());
saveAlteration("合同形式更改",per.getContractModality(),updateRequest.getContractModality(),type,updateRequest.getId());
saveAlteration("身份证附件更改",per.getCardFile(),personnel.getCardFile(),type,updateRequest.getId());
saveAlteration("学历证书附件更改",per.getEducationFile(),personnel.getEducationFile(),type,updateRequest.getId());
saveAlteration("审批资料附件更改",per.getAuditFile(),personnel.getAuditFile(),type,updateRequest.getId());
String card = StringUtils.join(saveFilePath(cardFile, AgesConst.CARD_FILE, AgesConst.UPDATE, updateRequest.getId()), ',');
String education = StringUtils.join(saveFilePath(educationFile,AgesConst.EDUCATION_FILE,AgesConst.UPDATE,updateRequest.getId()),',');
String audit = StringUtils.join(saveFilePath(auditFile,AgesConst.AUDIT_FILE,AgesConst.UPDATE,updateRequest.getId()),',');
if (per.getAuditState().equals(0)||per.getAuditState().equals(1)) {
return AjaxResult.fail().msg("该人员修改的资料未审批完成,请联系管理员!");
}
saveAttachment(cardFile,Personnel.CARD_FILE,personnel.getId());
saveAttachment(educationFile,Personnel.EDUCATION_FILE,personnel.getId());
saveAttachment(auditFile,Personnel.AUDIT_FILE,personnel.getId());
String type =AgesConst.PERSONNEL;
saveAlteration("民族更改",per.getNation(),updateRequest.getNation(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getNation));
saveAlteration("政治面貌更改",per.getPoliticsStatus(),updateRequest.getPoliticsStatus(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getPoliticsStatus));
saveAlteration("学历更改",per.getEducation(),updateRequest.getEducation(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getEducation));
saveAlteration("是否应届毕业生更改",per.getFreshGraduate(),updateRequest.getFreshGraduate(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getFreshGraduate));
saveAlteration("毕业院校更改",per.getAcademy(),updateRequest.getAcademy(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getAcademy));
saveAlteration("专业更改",per.getSpecialty(),updateRequest.getSpecialty(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getSpecialty));
saveAlteration("所在部门更改",per.getPresentDept(),updateRequest.getPresentDept(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getPresentDept));
saveAlteration("合同形式更改",per.getContractModality(),updateRequest.getContractModality(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getContractModality));
saveAlteration("身份证附件更改",per.getCardFile(),card,type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getCardFile));
saveAlteration("学历证书附件更改",per.getEducationFile(),education,type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getEducationFile));
saveAlteration("审批资料附件更改",per.getAuditFile(),audit,type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getAuditFile));
per.setAuditState(0);
boolean update = updateById(per);
saveAttachment(cardFile,AgesConst.CARD_FILE,updateRequest.getId(),AgesConst.UPDATE);
saveAttachment(educationFile,AgesConst.EDUCATION_FILE,updateRequest.getId(),AgesConst.UPDATE);
saveAttachment(auditFile,AgesConst.AUDIT_FILE,updateRequest.getId(),AgesConst.UPDATE);
return update ? AjaxResult.ok().msg("修改成功!"):AjaxResult.fail().msg("修改失败!");
}
@Override
public AjaxResult updateChange(ChangeRequest request) {
Personnel per = get(request.getId());
Personnel personnel = BeanUtil.copyProperties(request, Personnel.class);
List<AttachmentRequest> cardFiles = request.getCardFiles();
List<AttachmentRequest> jobTitleFiles = request.getJobTitleFiles();
List<AttachmentRequest> engageFiles = request.getEngageFiles();
List<AttachmentRequest> educationFiles = request.getEducationFiles();
List<AttachmentRequest> auditFiles = request.getAuditFiles();
personnel.setCardFile(StringUtils.join(saveFilePath(cardFiles,Personnel.CARD_FILE,"Change",personnel.getId()),','));
personnel.setJobTitleFile(StringUtils.join(saveFilePath(jobTitleFiles,Personnel.JOBTITLE_FILE,"Change",personnel.getId()),','));
personnel.setEngageFile(StringUtils.join(saveFilePath(engageFiles,Personnel.ENGAGE_FILE,"Change",personnel.getId()),','));
personnel.setEducationFile(StringUtils.join(saveFilePath(educationFiles,Personnel.EDUCATION_FILE,"Change",personnel.getId()),','));
personnel.setAuditFile(StringUtils.join(saveFilePath(auditFiles,Personnel.AUDIT_FILE,"Change",personnel.getId()),','));
boolean update = updateById(personnel);
String type ="Change";
if (update){
saveAlteration("录用方式更改",per.getHireType(),request.getHireType(),type,request.getId());
saveAlteration("执业资格更改",per.getQualification(),request.getQualification(),type,request.getId());
saveAlteration("专业技术职称更改",per.getJobTitle(),request.getJobTitle(),type,request.getId());
saveAlteration("岗位职务更改",per.getPosition(),request.getPosition(),type,request.getId());
saveAlteration("工作状态更改",per.getWorkState(),request.getWorkState(),type,request.getId());
saveAlteration("人员性质更改",per.getPersonnelCharacter(),request.getPersonnelCharacter(),type,request.getId());
saveAlteration("年薪更改",per.getAnnualSalary(),request.getAnnualSalary(),type,request.getId());
saveAlteration("退休时间更改",per.getRetirementTime(),request.getRetirementTime(),type,request.getId());
saveAlteration("人员招聘单号更改",per.getRecruitNumber(),request.getRecruitNumber(),type,request.getId());
saveAlteration("身份证附件更改",per.getCardFile(),personnel.getCardFile(),type,request.getId());
saveAlteration("聘任证书附件更改",per.getEngageFile(),personnel.getEngageFile(),type,request.getId());
saveAlteration("职称证书附件更改",per.getJobTitleFile(),personnel.getJobTitleFile(),type,request.getId());
saveAlteration("学历证书附件更改",per.getEducationFile(),personnel.getEducationFile(),type,request.getId());
saveAlteration("审批资料附件更改",per.getAuditFile(),personnel.getAuditFile(),type,request.getId());
if (per.getAuditState().equals(0)||per.getAuditState().equals(1)) {
return AjaxResult.fail().msg("该人员修改的资料未审批完成,请联系管理员!");
}
saveAttachment(cardFiles,Personnel.CARD_FILE,personnel.getId());
saveAttachment(jobTitleFiles,Personnel.JOBTITLE_FILE,personnel.getId());
saveAttachment(engageFiles,Personnel.ENGAGE_FILE,personnel.getId());
saveAttachment(educationFiles,Personnel.EDUCATION_FILE,personnel.getId());
saveAttachment(auditFiles,Personnel.AUDIT_FILE,personnel.getId());
String type =AgesConst.CHANGE;
String card = StringUtils.join(saveFilePath(cardFiles, AgesConst.CARD_FILE, type, request.getId()), ',');
String jobTitle = StringUtils.join(saveFilePath(jobTitleFiles,AgesConst.JOBTITLE_FILE,type,request.getId()),',');
String engage = StringUtils.join(saveFilePath(engageFiles,AgesConst.ENGAGE_FILE,type,request.getId()),',');
String education = StringUtils.join(saveFilePath(educationFiles,AgesConst.EDUCATION_FILE,type,request.getId()),',');
String audit = StringUtils.join(saveFilePath(auditFiles,AgesConst.AUDIT_FILE,type,request.getId()),',');
saveAlteration("录用方式更改",per.getHireType(),request.getHireType(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getHireType));
saveAlteration("执业资格更改",per.getQualification(),request.getQualification(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getQualification));
saveAlteration("专业技术职称更改",per.getJobTitle(),request.getJobTitle(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getJobTitle));
saveAlteration("岗位职务更改",per.getPosition(),request.getPosition(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getPosition));
saveAlteration("工作状态更改",per.getWorkState(),request.getWorkState(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getWorkState));
saveAlteration("人员性质更改",per.getPersonnelCharacter(),request.getPersonnelCharacter(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getPersonnelCharacter));
saveAlteration("年薪更改",per.getAnnualSalary(),request.getAnnualSalary(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getAnnualSalary));
saveAlteration("退休时间更改",per.getRetirementTime(),request.getRetirementTime(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getRetirementTime));
saveAlteration("人员招聘单号更改",per.getRecruitNumber(),request.getRecruitNumber(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getRecruitNumber));
saveAlteration("身份证附件更改",per.getCardFile(),card,type,request.getId(),ColumnUtil.getFieldName(Personnel::getCardFile));
saveAlteration("聘任证书附件更改",per.getEngageFile(),jobTitle,type,request.getId(),ColumnUtil.getFieldName(Personnel::getEngageFile));
saveAlteration("职称证书附件更改",per.getJobTitleFile(),engage,type,request.getId(),ColumnUtil.getFieldName(Personnel::getJobTitleFile));
saveAlteration("学历证书附件更改",per.getEducationFile(),education,type,request.getId(),ColumnUtil.getFieldName(Personnel::getEducationFile));
saveAlteration("审批资料附件更改",per.getAuditFile(),audit,type,request.getId(),ColumnUtil.getFieldName(Personnel::getAuditFile));
per.setAuditState(0);
boolean update = updateById(per);
saveAttachment(cardFiles,AgesConst.CARD_FILE,request.getId(),AgesConst.UPDATE);
saveAttachment(jobTitleFiles,AgesConst.JOBTITLE_FILE,request.getId(),AgesConst.UPDATE);
saveAttachment(engageFiles,AgesConst.ENGAGE_FILE,request.getId(),AgesConst.UPDATE);
saveAttachment(educationFiles,AgesConst.EDUCATION_FILE,request.getId(),AgesConst.UPDATE);
saveAttachment(auditFiles,AgesConst.AUDIT_FILE,request.getId(),AgesConst.UPDATE);
return update ? AjaxResult.ok().msg("修改成功!"):AjaxResult.fail().msg("修改失败!");
}
@ -219,12 +230,17 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
* @param type
* @param id
*/
public void saveAttachment(List<AttachmentRequest> file,String type, String id){
public void saveAttachment(List<AttachmentRequest> file,String type, String id,String ages){
if (CollectionUtil.isNotEmpty(file)){
for (AttachmentRequest request : file) {
Attachment attachment = BeanUtil.copyProperties(request, Attachment.class);
attachment.setTargetType(type);
attachment.setTargetId(id);
if (AgesConst.UPDATE.equals(ages)){
attachment.setFileState(0);
}else {
attachment.setFileState(1);
}
attachmentService.savePersonnel(attachment);
}
}
@ -243,7 +259,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
if (CollectionUtil.isNotEmpty(file)){
ArrayList<String> path = new ArrayList<>();
for (AttachmentRequest request : file) {
if ("update".equals(args)){
if (AgesConst.UPDATE.equals(args)){
attachmentService.deleteById(type,id);
}
path.add(request.getPath());
@ -253,10 +269,11 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
return new ArrayList<>();
}
public void saveAlteration(String details,Object before ,Object after,String type, String id){
if (ObjectUtil.isNotNull(after)){
public void saveAlteration(String details,Object before ,Object after,String type, String id,String fieldName){
if (!before.equals(after)){
Alteration alteration = new Alteration();
alteration.setDetails(details);
alteration.setFieldName(fieldName);
alteration.setType(type);
alteration.setRelevancyId(id);
if (ObjectUtil.isNotNull(before)){
@ -267,7 +284,6 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
alteration.setAfterChange(after.toString());
alterationMapper.insert(alteration);
}
}
public List<AttachmentDto> nameAndPath(String file,String id){
if (StrUtil.isNotBlank(file)){
@ -288,5 +304,38 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
}
return null;
}
public QueryWrapper selectWrapper(SelectRequest request,String orderBy,String column){
QueryWrapper<Personnel> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(StrUtil.isNotBlank(request.getPersonnelType()),Personnel::getPersonnelType,request.getPersonnelType())
.eq(StrUtil.isNotBlank(request.getPresentDept()),Personnel::getPresentDept,request.getPresentDept())
.eq(StrUtil.isNotBlank(request.getPoliticsStatus()),Personnel::getPoliticsStatus,request.getPoliticsStatus())
.eq(StrUtil.isNotBlank(request.getHireType()),Personnel::getHireType,request.getHireType())
.eq(StrUtil.isNotBlank(request.getPosition()),Personnel::getPosition,request.getPosition())
.eq(StrUtil.isNotBlank(request.getContractModality()),Personnel::getContractModality,request.getContractModality())
.eq(StrUtil.isNotBlank(request.getQualification()),Personnel::getQualification,request.getQualification())
.eq(StrUtil.isNotBlank(request.getPersonnelType()),Personnel::getPersonnelType,request.getPersonnelType())
.eq(ObjectUtil.isNotNull(request.getHireDate()),Personnel::getHireDate,request.getHireDate())
.eq(ObjectUtil.isNotNull(request.getResignationTime()),Personnel::getResignationTime,request.getResignationTime())
.eq(StrUtil.isNotBlank(request.getWorkState()),Personnel::getWorkState,request.getWorkState())
.eq(StrUtil.isNotBlank(request.getReceipts()),Personnel::getRecruitNumber,request.getReceipts())
.eq(StrUtil.isNotBlank(request.getAlterationSign()),Personnel::getAlterationSign,request.getAlterationSign());
wrapper.lambda().like(Personnel::getUserName,request.getUserName())
.like(Personnel::getNumberId,request.getNumberId())
/*.like(Personnel::getAuditFile,request.getFileName()).or()
.like(Personnel::getCardFile,request.getFileName()).or()
.like(Personnel::getEducationFile,request.getFileName()).or()
.like(Personnel::getEngageFile,request.getFileName()).or()
.like(Personnel::getJobTitleFile,request.getFileName()).or()*/
.exists(StrUtil.isNotBlank(request.getCompanyName()), "select t2.id from t_lc_company_name t2 where " +
"t_lc_personnel.company_name = t2.id and t2.company_name like '%" + request.getCompanyName() + "%'");
if ("desc".equals(orderBy) && StrUtil.isNotBlank(column)) {
wrapper.orderByDesc(column);
}
if ("asc".equals(orderBy) && StrUtil.isNotBlank(column)) {
wrapper.orderByAsc(column);
}
return wrapper;
}
}

View File

@ -19,6 +19,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
@RestController
@RequestMapping(value = UrlConstant.ATTACHMENT)
@Api(tags = "文件上传", value = "文件上传")
@ -36,7 +37,7 @@ public class UploadController {
return AjaxResult.fail("不能上传后缀为" + suffix + "的文件");
}
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);
}
@ -52,7 +53,7 @@ public class UploadController {
return AjaxResult.fail("不能上传后缀为" + suffix + "的文件");
}
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("上传失败!!!");
}