Commit b3dcf0dc authored by 韩桐桐's avatar 韩桐桐

企业人员导入

parent 5de9b242
package com.yeejoin.amos.boot.module.tcm.api.converter;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import java.util.HashMap;
import java.util.Map;
public class QualificationLevelConverter implements Converter<String> {
private static final Map<String,String> CODE_MAP = new HashMap<>();
static {
CODE_MAP.put("检验员","JYY");
CODE_MAP.put("检验师","JYS");
CODE_MAP.put("高级检验师","GJJYS");
}
@Override
public Class supportJavaTypeKey() {
return String.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
@Override
public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
String cellDataStr = cellData.getStringValue();
return CODE_MAP.get(cellDataStr);
}
@Override
public CellData convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
return null;
}
}
package com.yeejoin.amos.boot.module.tcm.api.converter;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import java.util.HashMap;
import java.util.Map;
public class QualificationProjectConverter implements Converter<String> {
private static final Map<String,String> CODE_MAP = new HashMap<>();
static {
CODE_MAP.put("机电类设备检验","JDG");
CODE_MAP.put("承压类设备检验","CYG");
CODE_MAP.put("大型游乐设施检验","YLY");
CODE_MAP.put("型式试验","CXY");
CODE_MAP.put("锅炉检验","GLY");
CODE_MAP.put("锅炉能效测试","GNY");
CODE_MAP.put("锅炉水(介)质检验","GSY");
CODE_MAP.put("压力容器检验","RQY");
CODE_MAP.put("气瓶检验","QPY");
CODE_MAP.put("压力管道检验","GDY");
CODE_MAP.put("电梯检验","DTY");
CODE_MAP.put("起重机械检验","QZY");
CODE_MAP.put("客运索道检验","SDY");
CODE_MAP.put("场(厂)内专用机动车辆检验","CCY");
}
@Override
public Class supportJavaTypeKey() {
return String.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
@Override
public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
String cellDataStr = cellData.getStringValue();
return CODE_MAP.get(cellDataStr);
}
@Override
public CellData convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
return null;
}
}
package com.yeejoin.amos.boot.module.tcm.api.dto;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.boot.module.tcm.api.converter.*;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.*;
@Data
public class CompanyUserImportDto {
@NotBlank(message = "姓名不能为空!")
@ExcelProperty(value = "姓名")
private String name;
@NotBlank(message = "联系电话不能为空!")
@ExcelProperty(value = "联系电话")
private String phone;
@NotBlank(message = "证件类型不能为空!")
@ExcelProperty(value = "证件类型", converter = CertificateTypeConverter.class)
private String certificateType;
@NotBlank(message = "证件编号不能为空!")
@ExcelProperty(value = "证件编号")
private String certificateNum;
@NotBlank(message = "人员类型不能为空!")
// @ExcelProperty(value = "人员类型", converter = PostTypeConverter.class)
@ExcelProperty(value = "人员类型")
private String post;
@ExcelIgnore
private String newPost;
// @ExcelProperty(value = "人员子类型", converter = PostTypeConverter.class)
@ExcelProperty(value = "人员子类型")
private String subPost;
@ExcelProperty(value = "性别", converter = GenderConverter.class)
private String gender;
@ExcelProperty(value = "出生日期")
@DateTimeFormat("yyyy-MM-dd")
private Date birthday;
@ExcelProperty(value = "学历", converter = EducationConverter.class)
private String education;
@ExcelProperty(value = "住址")
private String address;
@ExcelProperty(value = "邮箱")
private String email;
@ExcelProperty(value = "职称")
private String jobTitle;
@ExcelProperty(value = "专业")
private String speciality;
@ExcelIgnore()
private JSONArray permissionData66151 = new JSONArray();
@ExcelIgnore()
private JSONArray permissionData66152 = new JSONArray();
@ExcelIgnore()
private JSONArray permissionData6552 = new JSONArray();
/**
* 检验资质信息
*/
@Data
public static class InspectQualification {
@NotBlank(message = "证件编号不能为空!")
@ExcelProperty(value = "证件编号")
private String certificateNum;
@NotBlank(message = "发证机关不能为空!")
@ExcelProperty(value = "发证机关")
private String approvedOrgan;
@NotBlank(message = "检验资质级别不能为空!")
@ExcelProperty(value = "级别", converter = QualificationLevelConverter.class)
private String permissionLevel;
@NotBlank(message = "检验资质项目不能为空!")
@ExcelProperty(value = "项目", converter = QualificationProjectConverter.class)
private String permissionItem;
@NotBlank(message = "检验资质发证日期不能为空!")
@ExcelProperty(value = "发证日期")
@DateTimeFormat("yyyy-MM-dd")
private String issueDate;
@NotBlank(message = "检验资质有效期不能为空!")
@ExcelProperty(value = "有效期")
@DateTimeFormat("yyyy-MM-dd")
private String expiryDate;
}
/**
* 检测资质信息
*/
@Data
public static class TestingQualification {
@NotBlank(message = "证件编号不能为空!")
@ExcelProperty(value = "证件编号")
private String certificateNum;
@NotBlank(message = "发证机关不能为空!")
@ExcelProperty(value = "发证机关")
private String approvedOrgan;
@NotBlank(message = "检测资质级别不能为空!")
@ExcelProperty(value = "级别", converter = QualificationLevelConverter.class)
private String permissionLevel;
@NotBlank(message = "检测资质项目不能为空!")
@ExcelProperty(value = "项目", converter = QualificationProjectConverter.class)
private String permissionItem;
@NotBlank(message = "检测资质发证日期不能为空!")
@ExcelProperty(value = "发证日期")
@DateTimeFormat("yyyy-MM-dd")
private String issueDate;
@NotBlank(message = "检测资质有效期不能为空!")
@ExcelProperty(value = "有效期")
@DateTimeFormat("yyyy-MM-dd")
private String expiryDate;
}
/**
* 作业人员资质信息
*/
@Data
public static class OperatorQualifications {
@NotBlank(message = "作业人员资质证件编号不能为空!")
@ExcelProperty(value = "证件编号")
private String certificateNum;
@NotBlank(message = "作业人员资质发证机关不能为空!")
@ExcelProperty(value = "证书编号")
private String certNo;
@NotBlank(message = "作业人员资质证书类型不能为空!")
@ExcelProperty(value = "发证机关")
private String approvedOrgan;
@NotBlank(message = "作业人员资质证书类型不能为空!")
@ExcelProperty(value = "证书类型")
private String certType;
@NotBlank(message = "作业人员资质作业项目不能为空!")
@ExcelProperty(value = "作业项目")
private String jobItemStr;
@ExcelIgnore
private JSONArray jobItem;
@ExcelProperty(value = "金属焊接操作-项目代号")
private String JSHJCZItemCode;
@ExcelProperty(value = "非金属焊接操作-项目代号")
private String FJSHJCZItemCode;
@ExcelProperty(value = "其他作业项目")
private String otherItem;
@NotBlank(message = "检测资质发证日期不能为空!")
@ExcelProperty(value = "发证日期")
@DateTimeFormat("yyyy-MM-dd")
private String issueDate;
@NotBlank(message = "检测资质有效期不能为空!")
@ExcelProperty(value = "有效期")
@DateTimeFormat("yyyy-MM-dd")
private String expiryDate;
}
}
...@@ -85,6 +85,14 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> { ...@@ -85,6 +85,14 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
*/ */
ResponseModel<?> importUserBatch(MultipartFile file); ResponseModel<?> importUserBatch(MultipartFile file);
/**
* 企业人员导入
*
* @param file 导入的文件
* @return 失败时返回失败信息,提供时返回success
*/
ResponseModel<?> importCompanyUser(MultipartFile file, ReginParams reginParams);
String deletePersonSubtypeHistoricalData(); String deletePersonSubtypeHistoricalData();
List<DataDictionary> postByUnitType(CompanyBo company); List<DataDictionary> postByUnitType(CompanyBo company);
......
...@@ -382,6 +382,13 @@ public class TzsUserInfoController extends BaseController { ...@@ -382,6 +382,13 @@ public class TzsUserInfoController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/company/import")
@ApiOperation(value = "企业人员导入", httpMethod = "POST", notes = "企业人员导入")
public ResponseModel<?> importCompanyUser(@RequestBody MultipartFile file) {
return tzsUserInfoService.importCompanyUser(file, getSelectedOrgInfo());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/personnelTransferOut") @GetMapping(value = "/personnelTransferOut")
@ApiOperation(httpMethod = "GET", value = "人员转出:逻辑删除人员并删除关联的系统账号", notes = "人员转出:逻辑删除人员并删除关联的系统账号") @ApiOperation(httpMethod = "GET", value = "人员转出:逻辑删除人员并删除关联的系统账号", notes = "人员转出:逻辑删除人员并删除关联的系统账号")
public ResponseModel<Boolean> personnelTransferOut(@RequestParam(value = "userSeqNbrs") String userSeqNbrs) { public ResponseModel<Boolean> personnelTransferOut(@RequestParam(value = "userSeqNbrs") String userSeqNbrs) {
......
...@@ -109,7 +109,7 @@ public class TzsUserPermissionServiceImpl extends BaseService<TzsUserPermissionD ...@@ -109,7 +109,7 @@ public class TzsUserPermissionServiceImpl extends BaseService<TzsUserPermissionD
JSONArray permissionData6552 = userInfoDto.getPermissionData6552(); JSONArray permissionData6552 = userInfoDto.getPermissionData6552();
if (!ValidationUtil.isEmpty(permissionData6552)) { if (!ValidationUtil.isEmpty(permissionData6552)) {
permissionData6552.forEach(item -> { permissionData6552.forEach(item -> {
JSONObject itempermissionData6552 = (JSONObject) item; JSONObject itempermissionData6552 = JSONObject.parseObject(JSON.toJSONString(item));
// 前端无法处理后端手动判断 // 前端无法处理后端手动判断
// 作业项目中含有【金属焊接操作】,则【金属焊接操作-项目代号】必填 // 作业项目中含有【金属焊接操作】,则【金属焊接操作-项目代号】必填
// 作业项目中含有【非金属焊接操作】,则【非金属焊接操作-项目代号】必填 // 作业项目中含有【非金属焊接操作】,则【非金属焊接操作-项目代号】必填
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment