Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7d6aacc3f3
|
@ -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";
|
||||||
|
}
|
|
@ -39,6 +39,7 @@ public interface UrlConstant {
|
||||||
String ORGANIZATION = API + "/organization";
|
String ORGANIZATION = API + "/organization";
|
||||||
String PARTY_ORGANIZATION = API + "/party_organization";
|
String PARTY_ORGANIZATION = API + "/party_organization";
|
||||||
String DIRECTORS_SUPERVISORS = API + "/directors_supervisors";
|
String DIRECTORS_SUPERVISORS = API + "/directors_supervisors";
|
||||||
|
String ALTERATION = API + "/alteration";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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信息取出method、field、class等
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,14 @@ import com.ydool.common.data.dto.AjaxResult;
|
||||||
import com.ydool.common.utils.UploadUtils;
|
import com.ydool.common.utils.UploadUtils;
|
||||||
import com.ydool.staff.dto.PersonnelDto;
|
import com.ydool.staff.dto.PersonnelDto;
|
||||||
import com.ydool.staff.entity.Attachment;
|
import com.ydool.staff.entity.Attachment;
|
||||||
|
import com.ydool.staff.entity.SelectRequest;
|
||||||
import com.ydool.staff.request.ChangeRequest;
|
import com.ydool.staff.request.ChangeRequest;
|
||||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||||
import com.ydool.staff.request.PersonnelRequest;
|
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;
|
||||||
|
@ -40,14 +42,15 @@ public class PersonnelController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
IAttachmentService attachmentService;
|
IAttachmentService attachmentService;
|
||||||
|
|
||||||
@GetMapping( "personnelList")
|
@PostMapping( "personnelList")
|
||||||
@ApiOperation(value = "人员列表,传id查一条",response = PersonnelDto.class)
|
@ApiOperation(value = "人员列表,传id查一条",response = PersonnelDto.class)
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "orderBy", value = "排序顺序 降序:desc,升序:asc"),
|
||||||
|
@ApiImplicitParam(name = "column", value = "排序字段 字段名"),
|
||||||
@ApiImplicitParam(name = "current", value = "当前页"),
|
@ApiImplicitParam(name = "current", value = "当前页"),
|
||||||
@ApiImplicitParam(name = "size", value = "每页条数"),
|
@ApiImplicitParam(name = "size", value = "每页条数")})
|
||||||
@ApiImplicitParam(name = "id", value = "人员id")})
|
public AjaxResult personnelList(@RequestBody SelectRequest request, String orderBy,String column){
|
||||||
public AjaxResult personnelList(String id){
|
return personnelService.personnelList(getPage(),request,orderBy,column);
|
||||||
return personnelService.personnelList(getPage(),id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(value = "savePersonnel")
|
@PostMapping(value = "savePersonnel")
|
||||||
|
@ -72,6 +75,7 @@ public class PersonnelController extends BaseController {
|
||||||
return personnelService.updateChange(request);
|
return personnelService.updateChange(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/download")
|
@GetMapping("/download")
|
||||||
@ApiOperation(value = "下载文件")
|
@ApiOperation(value = "下载文件")
|
||||||
@ApiImplicitParams({@ApiImplicitParam(name = "path", value = "文件路径"), @ApiImplicitParam(name = "fileName", value = "文件名")})
|
@ApiImplicitParams({@ApiImplicitParam(name = "path", value = "文件路径"), @ApiImplicitParam(name = "fileName", value = "文件名")})
|
||||||
|
@ -86,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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,9 @@ public class Alteration extends BaseEntity{
|
||||||
@ApiModelProperty(value = "关联id")
|
@ApiModelProperty(value = "关联id")
|
||||||
private String relevancyId;
|
private String relevancyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "变更字段名称")
|
||||||
|
private String fieldName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "变更前")
|
@ApiModelProperty(value = "变更前")
|
||||||
private String beforeChange;
|
private String beforeChange;
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,10 @@ 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:已存")
|
||||||
|
private Integer fileState;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 = "姓名不能为空")
|
||||||
|
|
|
@ -32,12 +32,6 @@ public class Personnel extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
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 = "统一社会信用代码")
|
@ApiModelProperty(value = "统一社会信用代码")
|
||||||
private String socialCreditCode;
|
private String socialCreditCode;
|
||||||
|
|
||||||
|
@ -155,4 +149,10 @@ public class Personnel extends BaseEntity {
|
||||||
@ApiModelProperty(value = "变更标志")
|
@ApiModelProperty(value = "变更标志")
|
||||||
private String alterationSign;
|
private String alterationSign;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝")
|
||||||
|
private Integer auditState;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单据状态")
|
||||||
|
private String receipts;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class PersonnelUpdateRequest {
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否应届毕业生")
|
@ApiModelProperty(value = "是否应届毕业生")
|
||||||
@NotBlank(message = "是否应届毕业生不能为空")
|
@NotBlank(message = "是否应届毕业生不能为空")
|
||||||
private Boolean freshGraduate;
|
private Integer freshGraduate;
|
||||||
|
|
||||||
@ApiModelProperty(value = "毕业院校")
|
@ApiModelProperty(value = "毕业院校")
|
||||||
@NotBlank(message = "毕业院校不能为空")
|
@NotBlank(message = "毕业院校不能为空")
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.ydool.staff.service;
|
package com.ydool.staff.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ydool.common.data.dto.AjaxResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 变更记录表 服务类
|
* 变更记录表 服务类
|
||||||
|
@ -10,5 +13,7 @@ package com.ydool.staff.service;
|
||||||
*/
|
*/
|
||||||
public interface IAlterationService {
|
public interface IAlterationService {
|
||||||
|
|
||||||
|
AjaxResult alterationList(String id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.ydool.staff.service;
|
||||||
|
|
||||||
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.SelectRequest;
|
||||||
import com.ydool.staff.request.ChangeRequest;
|
import com.ydool.staff.request.ChangeRequest;
|
||||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||||
import com.ydool.staff.request.PersonnelRequest;
|
import com.ydool.staff.request.PersonnelRequest;
|
||||||
|
@ -22,7 +23,7 @@ public interface IPersonnelService {
|
||||||
* 人员列表
|
* 人员列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult personnelList(Page page , String id);
|
AjaxResult personnelList(Page page , SelectRequest request, String orderBy,String column);
|
||||||
|
|
||||||
AjaxResult personnelByExchangeList();
|
AjaxResult personnelByExchangeList();
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,26 @@
|
||||||
package com.ydool.staff.service.impl;
|
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.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.Alteration;
|
||||||
|
import com.ydool.staff.entity.Organization;
|
||||||
|
import com.ydool.staff.entity.Personnel;
|
||||||
import com.ydool.staff.mapper.AlterationMapper;
|
import com.ydool.staff.mapper.AlterationMapper;
|
||||||
import com.ydool.staff.service.IAlterationService;
|
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 org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 变更记录表 服务类
|
* 变更记录表 服务类
|
||||||
|
@ -17,5 +32,19 @@ import org.springframework.stereotype.Service;
|
||||||
@Service
|
@Service
|
||||||
public class AlterationServiceImpl extends BaseService<AlterationMapper, Alteration> implements IAlterationService {
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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());
|
||||||
|
|
|
@ -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("新增失败!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -1,22 +1,29 @@
|
||||||
package com.ydool.staff.service.impl;
|
package com.ydool.staff.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
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.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ydool.common.base.BaseService;
|
import com.ydool.common.base.BaseService;
|
||||||
|
import com.ydool.common.constant.AgesConst;
|
||||||
import com.ydool.common.data.dto.AjaxResult;
|
import com.ydool.common.data.dto.AjaxResult;
|
||||||
|
import com.ydool.common.utils.ColumnUtil;
|
||||||
import com.ydool.staff.dto.AttachmentDto;
|
import com.ydool.staff.dto.AttachmentDto;
|
||||||
import com.ydool.staff.dto.PersonnelByExchangeDto;
|
import com.ydool.staff.dto.PersonnelByExchangeDto;
|
||||||
import com.ydool.staff.dto.PersonnelDto;
|
import com.ydool.staff.dto.PersonnelDto;
|
||||||
import com.ydool.staff.dto.PersonnelUpdateDto;
|
import com.ydool.staff.dto.PersonnelUpdateDto;
|
||||||
import com.ydool.staff.entity.Alteration;
|
import com.ydool.staff.entity.Alteration;
|
||||||
import com.ydool.staff.entity.Attachment;
|
import com.ydool.staff.entity.Attachment;
|
||||||
|
import com.ydool.staff.entity.CompanyName;
|
||||||
import com.ydool.staff.entity.Organization;
|
import com.ydool.staff.entity.Organization;
|
||||||
import com.ydool.staff.entity.Personnel;
|
import com.ydool.staff.entity.Personnel;
|
||||||
|
import com.ydool.staff.entity.SelectRequest;
|
||||||
import com.ydool.staff.mapper.AlterationMapper;
|
import com.ydool.staff.mapper.AlterationMapper;
|
||||||
|
import com.ydool.staff.mapper.CompanyNameMapper;
|
||||||
import com.ydool.staff.mapper.OrganizationMapper;
|
import com.ydool.staff.mapper.OrganizationMapper;
|
||||||
import com.ydool.staff.mapper.PersonnelMapper;
|
import com.ydool.staff.mapper.PersonnelMapper;
|
||||||
import com.ydool.staff.request.AttachmentRequest;
|
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.staff.service.IPersonnelService;
|
||||||
import com.ydool.system.entity.Dept;
|
import com.ydool.system.entity.Dept;
|
||||||
import com.ydool.system.mapper.DeptMapper;
|
import com.ydool.system.mapper.DeptMapper;
|
||||||
|
import org.apache.poi.ss.formula.functions.Column;
|
||||||
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 org.thymeleaf.util.StringUtils;
|
||||||
|
@ -58,7 +66,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
@Resource
|
@Resource
|
||||||
private AlterationMapper alterationMapper;
|
private AlterationMapper alterationMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private OrganizationMapper organizationMapper;
|
private CompanyNameMapper companyNameMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private DeptMapper deptMapper;
|
private DeptMapper deptMapper;
|
||||||
|
|
||||||
|
@ -68,9 +76,9 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult personnelList(Page page , String id) {
|
public AjaxResult personnelList(Page page , SelectRequest request, String orderBy,String column) {
|
||||||
if (ObjectUtil.isNotNull(id)){
|
if (StrUtil.isNotBlank(request.getId())){
|
||||||
Personnel personnel = personnelMapper.selectById(id);
|
Personnel personnel = personnelMapper.selectById(request.getId());
|
||||||
PersonnelUpdateDto personnelUpdateDto = BeanUtil.copyProperties(personnel, PersonnelUpdateDto.class);
|
PersonnelUpdateDto personnelUpdateDto = BeanUtil.copyProperties(personnel, PersonnelUpdateDto.class);
|
||||||
personnelUpdateDto.setCardFiles(nameAndPath(personnel.getCardFile(), personnel.getId()));
|
personnelUpdateDto.setCardFiles(nameAndPath(personnel.getCardFile(), personnel.getId()));
|
||||||
personnelUpdateDto.setEngageFiles(nameAndPath(personnel.getEngageFile(), 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()));
|
personnelUpdateDto.setAuditFiles(nameAndPath(personnel.getAuditFile(), personnel.getId()));
|
||||||
return AjaxResult.ok().data(personnelUpdateDto);
|
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();
|
List<Personnel> list = personnelPage.getRecords();
|
||||||
personnelPage.setRecords(list.stream().map(e->{
|
personnelPage.setRecords(list.stream().map(e->{
|
||||||
PersonnelDto dto = BeanUtil.copyProperties(e, PersonnelDto.class);
|
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());
|
Dept dept = deptMapper.selectById(e.getPresentDept());
|
||||||
dto.setPresentDept(dept.getName());
|
dto.setPresentDept(dept.getName());
|
||||||
dto.setCompanyName(organization.getCompanyName());
|
dto.setCompanyName(companyName.getCompanyName());
|
||||||
dto.setCreatedAt(e.getCreatedAt());
|
dto.setCreatedAt(e.getCreatedAt());
|
||||||
return dto;
|
return dto;
|
||||||
}).collect(Collectors.toList()));
|
}).collect(Collectors.toList()));
|
||||||
|
@ -110,17 +120,17 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AjaxResult savePersonnel(PersonnelRequest personnelRequest) {
|
public AjaxResult savePersonnel(PersonnelRequest personnelRequest) {
|
||||||
Personnel personnel = BeanUtil.copyProperties(personnelRequest, Personnel.class);
|
Personnel personnel = BeanUtil.copyProperties(personnelRequest, Personnel.class);
|
||||||
personnel.setCardFile(StringUtils.join(saveFilePath(personnelRequest.getCardFile(),Personnel.CARD_FILE,"",""),','));
|
personnel.setCardFile(StringUtils.join(saveFilePath(personnelRequest.getCardFile(),AgesConst.CARD_FILE,AgesConst.SAVE,""),','));
|
||||||
personnel.setEngageFile(StringUtils.join(saveFilePath(personnelRequest.getEngageFile(),Personnel.ENGAGE_FILE,"",""),','));
|
personnel.setEngageFile(StringUtils.join(saveFilePath(personnelRequest.getEngageFile(),AgesConst.ENGAGE_FILE,AgesConst.SAVE,""),','));
|
||||||
personnel.setJobTitleFile(StringUtils.join(saveFilePath(personnelRequest.getJobTitleFile(),Personnel.EDUCATION_FILE,"",""),','));
|
personnel.setJobTitleFile(StringUtils.join(saveFilePath(personnelRequest.getJobTitleFile(),AgesConst.EDUCATION_FILE,AgesConst.SAVE,""),','));
|
||||||
personnel.setEducationFile(StringUtils.join(saveFilePath(personnelRequest.getEducationFile(),Personnel.JOBTITLE_FILE,"",""),','));
|
personnel.setEducationFile(StringUtils.join(saveFilePath(personnelRequest.getEducationFile(),AgesConst.JOBTITLE_FILE,AgesConst.SAVE,""),','));
|
||||||
personnel.setAuditFile(StringUtils.join(saveFilePath(personnelRequest.getAuditFile(),Personnel.AUDIT_FILE,"",""),','));
|
personnel.setAuditFile(StringUtils.join(saveFilePath(personnelRequest.getAuditFile(),AgesConst.AUDIT_FILE,AgesConst.SAVE,""),','));
|
||||||
boolean save = save(personnel);
|
boolean save = save(personnel);
|
||||||
saveAttachment(personnelRequest.getCardFile(),Personnel.CARD_FILE,personnel.getId());
|
saveAttachment(personnelRequest.getCardFile(),AgesConst.CARD_FILE,personnel.getId(),AgesConst.SAVE);
|
||||||
saveAttachment(personnelRequest.getEngageFile(),Personnel.ENGAGE_FILE,personnel.getId());
|
saveAttachment(personnelRequest.getEngageFile(),AgesConst.ENGAGE_FILE,personnel.getId(),AgesConst.SAVE);
|
||||||
saveAttachment(personnelRequest.getEducationFile(),Personnel.EDUCATION_FILE,personnel.getId());
|
saveAttachment(personnelRequest.getEducationFile(),AgesConst.EDUCATION_FILE,personnel.getId(),AgesConst.SAVE);
|
||||||
saveAttachment(personnelRequest.getJobTitleFile(),Personnel.JOBTITLE_FILE,personnel.getId());
|
saveAttachment(personnelRequest.getJobTitleFile(),AgesConst.JOBTITLE_FILE,personnel.getId(),AgesConst.SAVE);
|
||||||
saveAttachment(personnelRequest.getAuditFile(),Personnel.AUDIT_FILE,personnel.getId());
|
saveAttachment(personnelRequest.getAuditFile(),AgesConst.AUDIT_FILE,personnel.getId(),AgesConst.SAVE);
|
||||||
return save ? AjaxResult.ok().msg("保存成功!"):AjaxResult.fail().msg("保存失败!");
|
return save ? AjaxResult.ok().msg("保存成功!"):AjaxResult.fail().msg("保存失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,73 +153,74 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AjaxResult updatePersonnel(PersonnelUpdateRequest updateRequest) {
|
public AjaxResult updatePersonnel(PersonnelUpdateRequest updateRequest) {
|
||||||
Personnel per = get(updateRequest.getId());
|
Personnel per = get(updateRequest.getId());
|
||||||
Personnel personnel = BeanUtil.copyProperties(updateRequest, Personnel.class);
|
|
||||||
List<AttachmentRequest> cardFile = updateRequest.getCardFile();
|
List<AttachmentRequest> cardFile = updateRequest.getCardFile();
|
||||||
List<AttachmentRequest> educationFile = updateRequest.getEducationFile();
|
List<AttachmentRequest> educationFile = updateRequest.getEducationFile();
|
||||||
List<AttachmentRequest> auditFile = updateRequest.getAuditFile();
|
List<AttachmentRequest> auditFile = updateRequest.getAuditFile();
|
||||||
personnel.setCardFile(StringUtils.join(saveFilePath(cardFile,Personnel.CARD_FILE,"update",personnel.getId()),','));
|
String card = StringUtils.join(saveFilePath(cardFile, AgesConst.CARD_FILE, AgesConst.UPDATE, updateRequest.getId()), ',');
|
||||||
personnel.setEducationFile(StringUtils.join(saveFilePath(educationFile,Personnel.EDUCATION_FILE,"update",personnel.getId()),','));
|
String education = StringUtils.join(saveFilePath(educationFile,AgesConst.EDUCATION_FILE,AgesConst.UPDATE,updateRequest.getId()),',');
|
||||||
personnel.setAuditFile(StringUtils.join(saveFilePath(auditFile,Personnel.AUDIT_FILE,"update",personnel.getId()),','));
|
String audit = StringUtils.join(saveFilePath(auditFile,AgesConst.AUDIT_FILE,AgesConst.UPDATE,updateRequest.getId()),',');
|
||||||
boolean update = updateById(personnel);
|
if (per.getAuditState().equals(0)||per.getAuditState().equals(1)) {
|
||||||
String type ="personnel";
|
return AjaxResult.fail().msg("该人员修改的资料未审批完成,请联系管理员!");
|
||||||
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());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
saveAttachment(cardFile,Personnel.CARD_FILE,personnel.getId());
|
String type =AgesConst.PERSONNEL;
|
||||||
saveAttachment(educationFile,Personnel.EDUCATION_FILE,personnel.getId());
|
saveAlteration("民族更改",per.getNation(),updateRequest.getNation(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getNation));
|
||||||
saveAttachment(auditFile,Personnel.AUDIT_FILE,personnel.getId());
|
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("修改失败!");
|
return update ? AjaxResult.ok().msg("修改成功!"):AjaxResult.fail().msg("修改失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult updateChange(ChangeRequest request) {
|
public AjaxResult updateChange(ChangeRequest request) {
|
||||||
Personnel per = get(request.getId());
|
Personnel per = get(request.getId());
|
||||||
Personnel personnel = BeanUtil.copyProperties(request, Personnel.class);
|
|
||||||
List<AttachmentRequest> cardFiles = request.getCardFiles();
|
List<AttachmentRequest> cardFiles = request.getCardFiles();
|
||||||
List<AttachmentRequest> jobTitleFiles = request.getJobTitleFiles();
|
List<AttachmentRequest> jobTitleFiles = request.getJobTitleFiles();
|
||||||
List<AttachmentRequest> engageFiles = request.getEngageFiles();
|
List<AttachmentRequest> engageFiles = request.getEngageFiles();
|
||||||
List<AttachmentRequest> educationFiles = request.getEducationFiles();
|
List<AttachmentRequest> educationFiles = request.getEducationFiles();
|
||||||
List<AttachmentRequest> auditFiles = request.getAuditFiles();
|
List<AttachmentRequest> auditFiles = request.getAuditFiles();
|
||||||
personnel.setCardFile(StringUtils.join(saveFilePath(cardFiles,Personnel.CARD_FILE,"Change",personnel.getId()),','));
|
if (per.getAuditState().equals(0)||per.getAuditState().equals(1)) {
|
||||||
personnel.setJobTitleFile(StringUtils.join(saveFilePath(jobTitleFiles,Personnel.JOBTITLE_FILE,"Change",personnel.getId()),','));
|
return AjaxResult.fail().msg("该人员修改的资料未审批完成,请联系管理员!");
|
||||||
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());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
saveAttachment(cardFiles,Personnel.CARD_FILE,personnel.getId());
|
String type =AgesConst.CHANGE;
|
||||||
saveAttachment(jobTitleFiles,Personnel.JOBTITLE_FILE,personnel.getId());
|
String card = StringUtils.join(saveFilePath(cardFiles, AgesConst.CARD_FILE, type, request.getId()), ',');
|
||||||
saveAttachment(engageFiles,Personnel.ENGAGE_FILE,personnel.getId());
|
String jobTitle = StringUtils.join(saveFilePath(jobTitleFiles,AgesConst.JOBTITLE_FILE,type,request.getId()),',');
|
||||||
saveAttachment(educationFiles,Personnel.EDUCATION_FILE,personnel.getId());
|
String engage = StringUtils.join(saveFilePath(engageFiles,AgesConst.ENGAGE_FILE,type,request.getId()),',');
|
||||||
saveAttachment(auditFiles,Personnel.AUDIT_FILE,personnel.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("修改失败!");
|
return update ? AjaxResult.ok().msg("修改成功!"):AjaxResult.fail().msg("修改失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,12 +230,17 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
* @param type
|
* @param type
|
||||||
* @param id
|
* @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)){
|
if (CollectionUtil.isNotEmpty(file)){
|
||||||
for (AttachmentRequest request : file) {
|
for (AttachmentRequest request : file) {
|
||||||
Attachment attachment = BeanUtil.copyProperties(request, Attachment.class);
|
Attachment attachment = BeanUtil.copyProperties(request, Attachment.class);
|
||||||
attachment.setTargetType(type);
|
attachment.setTargetType(type);
|
||||||
attachment.setTargetId(id);
|
attachment.setTargetId(id);
|
||||||
|
if (AgesConst.UPDATE.equals(ages)){
|
||||||
|
attachment.setFileState(0);
|
||||||
|
}else {
|
||||||
|
attachment.setFileState(1);
|
||||||
|
}
|
||||||
attachmentService.savePersonnel(attachment);
|
attachmentService.savePersonnel(attachment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,7 +259,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
if (CollectionUtil.isNotEmpty(file)){
|
if (CollectionUtil.isNotEmpty(file)){
|
||||||
ArrayList<String> path = new ArrayList<>();
|
ArrayList<String> path = new ArrayList<>();
|
||||||
for (AttachmentRequest request : file) {
|
for (AttachmentRequest request : file) {
|
||||||
if ("update".equals(args)){
|
if (AgesConst.UPDATE.equals(args)){
|
||||||
attachmentService.deleteById(type,id);
|
attachmentService.deleteById(type,id);
|
||||||
}
|
}
|
||||||
path.add(request.getPath());
|
path.add(request.getPath());
|
||||||
|
@ -253,10 +269,11 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveAlteration(String details,Object before ,Object after,String type, String id){
|
public void saveAlteration(String details,Object before ,Object after,String type, String id,String fieldName){
|
||||||
if (ObjectUtil.isNotNull(after)){
|
if (!before.equals(after)){
|
||||||
Alteration alteration = new Alteration();
|
Alteration alteration = new Alteration();
|
||||||
alteration.setDetails(details);
|
alteration.setDetails(details);
|
||||||
|
alteration.setFieldName(fieldName);
|
||||||
alteration.setType(type);
|
alteration.setType(type);
|
||||||
alteration.setRelevancyId(id);
|
alteration.setRelevancyId(id);
|
||||||
if (ObjectUtil.isNotNull(before)){
|
if (ObjectUtil.isNotNull(before)){
|
||||||
|
@ -267,7 +284,6 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
alteration.setAfterChange(after.toString());
|
alteration.setAfterChange(after.toString());
|
||||||
alterationMapper.insert(alteration);
|
alterationMapper.insert(alteration);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public List<AttachmentDto> nameAndPath(String file,String id){
|
public List<AttachmentDto> nameAndPath(String file,String id){
|
||||||
if (StrUtil.isNotBlank(file)){
|
if (StrUtil.isNotBlank(file)){
|
||||||
|
@ -288,5 +304,38 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
}
|
}
|
||||||
return null;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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("上传失败!!!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue