Commit bc39f947 authored by chenhao's avatar chenhao

提交维保的逻辑代码 by陈浩

提交内容: 1:修改维保单位、人员接口拿去参数的方式。 2:修改了原来gettree公共方法的错误 3: 添加了维保人员功能的 excle的数据导入和魔板导出方法
parent a9ecb809
...@@ -21,15 +21,20 @@ import lombok.experimental.Accessors; ...@@ -21,15 +21,20 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "MaintenancePersonDto", description = "维保单位人员") @ApiModel(value = "MaintenancePersonDto", description = "维保单位人员")
public class MaintenancePersonDto extends BaseDto{ public class MaintenancePersonDto extends BaseDto {
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "员工姓名")
private String name;
@ApiModelProperty(value = "注册号")
private String amosAccount;
@ApiModelProperty(value = "类型(COMPANY单位,PERSON人员,DEPARTMENT部门)") @ApiModelProperty(value = "类型(COMPANY单位,PERSON人员,DEPARTMENT部门)")
private String type; private String type;
@ApiModelProperty(value = "关联系统账号")
private String amosAccount;
@ApiModelProperty(value = "类别") @ApiModelProperty(value = "类别")
private String category; private String category;
@ApiModelProperty(value = "证书编号") @ApiModelProperty(value = "证书编号")
...@@ -64,11 +69,14 @@ public class MaintenancePersonDto extends BaseDto{ ...@@ -64,11 +69,14 @@ public class MaintenancePersonDto extends BaseDto{
@ApiModelProperty(value = "注册有效期结束时间") @ApiModelProperty(value = "注册有效期结束时间")
private String registrationEndTime; private String registrationEndTime;
@ApiModelProperty(value = "员工姓名") @ApiModelProperty(value = "员工编号")
private String name; private String code;
@ApiModelProperty(value = "员工所在单位单位id") @ApiModelProperty(value = "员工所在单位单位id")
private Long parentId; private Long parentId;
@ApiModelProperty(value = "上传资源的地址集合") @ApiModelProperty(value = "上传资源的地址集合")
private List<String> resourcesAdress; private List<String> resourcesAdress;
} }
package com.yeejoin.amos.boot.module.common.api.dto;
import java.io.Serializable;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "MaintenancePersonDto", description = "维保单位人员")
public class MaintenancePersonExcleDto implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "序号", index = 0)
@ApiModelProperty(value = "序号")
private Integer number;
@ExcelProperty(value = "姓名", index = 1)
@ApiModelProperty(value = "姓名")
private String name;
@ExcelProperty(value = "员工编号", index =2)
@ApiModelProperty(value = "员工编号")
protected String code;
@ExplicitConstraint(indexNum = 3, sourceClass = RoleNameExplicitConstraint.class, method = "getCompanyAndDeparementTree") //固定下拉内容
@ApiModelProperty(value = "所属单位及部门")
private String parentId;
@ExplicitConstraint(type = "XB", indexNum = 10, sourceClass = RoleNameExplicitConstraint.class)
@ApiModelProperty(value = "性别")
private String gender;
@ExcelProperty(value = "身份证号码", index =5)
@ApiModelProperty(value = "身份证号码")
private String idNumber;
@ExcelProperty(value = "手机号码", index =6)
@ApiModelProperty(value = "手机号码")
private String tel;
@ExcelProperty(value = "民族", index =7)
@ApiModelProperty(value = "民族")
private String nation;
//项目负责人、消防设施操作员
@ExcelProperty(value = "类别", index =8)
@ApiModelProperty(value = "类别")
private String category;
@ExcelProperty(value = "统账号", index = 9)
@ApiModelProperty(value = "系统账户")
private String systemAccount;
@ExplicitConstraint(type = "WBRYZT", indexNum = 10, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "人员状态")
private String status;
@ExplicitConstraint(type = "WBZYZS", indexNum = 11, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "职业资格证书")
private String professionalCertificate;
@ExplicitConstraint(type = "WBZYZG", indexNum = 12, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "职业资格")
private String qualification;
@ExcelProperty(value = "证书编号", index =13)
@ApiModelProperty(value = "证书编号")
private String certificateNo;
@ExcelProperty(value = "注册有效期开始时间", index = 14)
@ApiModelProperty(value = "注册有效期开始时间")
private String registrationStartTime;
@ExcelProperty(value = "注册有效期结束时间", index = 15)
@ApiModelProperty(value = "注册有效期结束时间")
private String registrationEndTime;
@ExcelProperty(value = "注册号", index = 16)
@ApiModelProperty(value = "注册号")
private String amosAccount;
}
package com.yeejoin.amos.boot.module.common.api.entity; package com.yeejoin.amos.boot.module.common.api.entity;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/** /**
* 维保单位 * 维保单位
...@@ -16,8 +18,7 @@ import lombok.experimental.Accessors; ...@@ -16,8 +18,7 @@ import lombok.experimental.Accessors;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @TableName(value = "cb_maintenance_company")
@TableName(value = "cb_maintenance_company",autoResultMap = true)
public class MaintenanceCompany extends BaseEntity { public class MaintenanceCompany extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -35,7 +36,7 @@ public class MaintenanceCompany extends BaseEntity { ...@@ -35,7 +36,7 @@ public class MaintenanceCompany extends BaseEntity {
private String code; private String code;
/** /**
* 类型(COMPANY单位,PERSON人员) * 类型(COMPANY单位,PERSON人员,DEPARTMENT部门
*/ */
@TableField("type") @TableField("type")
private String type; private String type;
...@@ -76,8 +77,10 @@ public class MaintenanceCompany extends BaseEntity { ...@@ -76,8 +77,10 @@ public class MaintenanceCompany extends BaseEntity {
@TableField("instance_id") @TableField("instance_id")
private Long instanceId; private Long instanceId;
//@Transient
@ApiModelProperty(value = "动态表单值")
@TableField(exist = false)
private List<DynamicFormInstance> dynamicFormValue;
......
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenanceCompanyDto; import com.yeejoin.amos.boot.module.common.api.dto.MaintenanceCompanyDto;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenanceDepartmentDto; import com.yeejoin.amos.boot.module.common.api.dto.MaintenanceDepartmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonDto; import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -20,18 +21,19 @@ public interface IMaintenanceCompanyService { ...@@ -20,18 +21,19 @@ public interface IMaintenanceCompanyService {
/** /**
* 添加保存维保公司基本信息 * 添加保存维保公司基本信息
* *
* @param maintenanceCompanyDto * @param MaintenanceCompany
* @return * @return
*/ */
public boolean saveCompanyDetail(MaintenanceCompanyDto maintenanceCompanyDto); public boolean saveCompanyDetail(MaintenanceCompany maintenanceCompany);
/** /**
* 添加保存维保单位人员基本信息 * 添加保存维保单位人员基本信息
* *
* @param maintenanceCompany * @param MaintenanceCompany
* @param sequenceNbr主键
* @return * @return
*/ */
public boolean savePersonDetail(MaintenancePersonDto maintenancePerson, Map<String, Long> params); public boolean savePersonDetail(MaintenanceCompany maintenanceCompany, long sequenceNbr);
/** /**
* 自定义假删除 * 自定义假删除
...@@ -51,15 +53,15 @@ public interface IMaintenanceCompanyService { ...@@ -51,15 +53,15 @@ public interface IMaintenanceCompanyService {
/** /**
* 添加保存维保单位部门基本信息 * 添加保存维保单位部门基本信息
* *
* @param maintenanceDepartment * @param MaintenanceCompany
* @return * @return
*/ */
public boolean saveDepartmentDetail(MaintenanceDepartmentDto maintenanceDepartment, long sequenceNbr) ; public boolean saveDepartmentDetail(MaintenanceCompany maintenanceCompany, long sequenceNbr) ;
/** /**
* 检查当前的员工编号是否已经存在 * 检查当前的员工编号是否已经存在
* *
* @param code * @param code 员工编号
* @return * @return
*/ */
public boolean checkPersonCodeExists(String code); public boolean checkPersonCodeExists(String code);
...@@ -74,7 +76,7 @@ public interface IMaintenanceCompanyService { ...@@ -74,7 +76,7 @@ public interface IMaintenanceCompanyService {
/** /**
* 查询分页展示的维保人员/单位/部门列表信息 * 查询分页展示的维保人员/单位/部门列表信息
* * @param Map<String, Object>
* @param current 页码起始值 * @param current 页码起始值
* @param size 行数 * @param size 行数
* @param informationCard 是否显示维保单位人员信息卡数据项 * @param informationCard 是否显示维保单位人员信息卡数据项
...@@ -92,27 +94,27 @@ public interface IMaintenanceCompanyService { ...@@ -92,27 +94,27 @@ public interface IMaintenanceCompanyService {
/** /**
* 修改维保单位 * 修改维保单位
* @param model * @param MaintenanceCompany
* @return * @return
*/ */
boolean updateMaintenanceCompanyDetail(MaintenanceCompanyDto model,AgencyUserModel userInfo); boolean updateMaintenanceCompanyDetail(MaintenanceCompany model,AgencyUserModel userInfo);
/** /**
* 修改维保部门 * 修改维保部门
* @param MaintenanceDepartmentDto * @param MaintenanceCompany
* @return * @return
*/ */
public boolean updateMaintenancDepartmentDetail(MaintenanceDepartmentDto model,AgencyUserModel userInfo); public boolean updateMaintenancDepartmentDetail(MaintenanceCompany model,AgencyUserModel userInfo);
/** /**
* 修改维保人员 * 修改维保人员
* @param MaintenancePersonDto * @param MaintenanceCompany
* @return * @return
*/ */
public boolean updateMaintenancePersonDetail(MaintenancePersonDto model,AgencyUserModel userInfo); public boolean updateMaintenancePersonDetail(MaintenanceCompany model,AgencyUserModel userInfo);
/** /**
* 查询所有的单位-部门树 * 查询所有的单位-部门树
* @return * @return
......
...@@ -13,4 +13,5 @@ public class ExcelEnums { ...@@ -13,4 +13,5 @@ public class ExcelEnums {
public static final String XFRY = "XFRY";//("XFRY","消防人员") public static final String XFRY = "XFRY";//("XFRY","消防人员")
public static final String CLZQ = "CLZQ";//("CLZQ","车辆执勤") public static final String CLZQ = "CLZQ";//("CLZQ","车辆执勤")
public static final String RYZB = "RYZB";//("RYZB","人员值班") public static final String RYZB = "RYZB";//("RYZB","人员值班")
public static final String WBRY = "WBRY";//("WBRY",维保人员)
} }
...@@ -135,14 +135,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -135,14 +135,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
String.valueOf(OrgTypeMethodNameme.invoke(entity)), false); String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
resultList.add(menu); resultList.add(menu);
} else { } else if(topId !=null && topId.longValue() ==parentId.longValue())
if(topId !=null && topId.longValue() ==parentId.longValue()) { {
OrgMenuDto menu = new OrgMenuDto(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))), OrgMenuDto menu = new OrgMenuDto(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))),
String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
String.valueOf(OrgTypeMethodNameme.invoke(entity)), false); String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
resultList.add(menu); resultList.add(menu);
} }
}
/* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---end******************************/ /* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---end******************************/
} }
// 获取每个顶层元素的子数据集合 // 获取每个顶层元素的子数据集合
......
...@@ -3,22 +3,16 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller; ...@@ -3,22 +3,16 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.io.InputStream; import java.io.InputStream;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.biz.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.EquipmentServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.beanutils.ConvertUtils;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
...@@ -26,19 +20,69 @@ import org.apache.poi.xssf.usermodel.XSSFSheet; ...@@ -26,19 +20,69 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireChemical;
import com.yeejoin.amos.boot.module.common.api.entity.FireExperts;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.biz.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCommonServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonShiftServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyShiftServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireChemicalServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireExpertsServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AircraftServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AircraftServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.EquipmentServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -88,8 +132,12 @@ public class ExcelController extends BaseController { ...@@ -88,8 +132,12 @@ public class ExcelController extends BaseController {
OrgUsrServiceImpl orgUsrService; OrgUsrServiceImpl orgUsrService;
@Autowired @Autowired
IDutyPersonService iDutyPersonService; IDutyPersonService iDutyPersonService;
@Autowired
IMaintenanceCompanyService maintenanceCompanyService;
private static final String NOT_DUTY = "休班"; private static final String NOT_DUTY = "休班";
private static final String PERSON = "PERSON";
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
...@@ -189,14 +237,45 @@ public class ExcelController extends BaseController { ...@@ -189,14 +237,45 @@ public class ExcelController extends BaseController {
break; break;
case ExcelEnums.RYZB: case ExcelEnums.RYZB:
excelImportDutyPerson(multipartFile, ExcelEnums.RYZB); excelImportDutyPerson(multipartFile, ExcelEnums.RYZB);
case ExcelEnums.WBRY:
excelImportMaintenancePerson(multipartFile, ExcelEnums.WBRY);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
} }
} }
/**
private void excelImportDutyPerson(MultipartFile multipartFile, String dutyType) throws Exception { * @author chenhao
* @param multipartFile
* @param wbry
* @throws Exception
*/
private void excelImportMaintenancePerson(MultipartFile multipartFile, String wbry) throws Exception {
List<MaintenancePersonExcleDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
MaintenancePersonExcleDto.class, 1);
excelDtoList.forEach(
item -> {
MaintenanceCompany maintenancePersonDto = new MaintenanceCompany();
List<DynamicFormInstance> dynamicFormValueList =new ArrayList<DynamicFormInstance>();
maintenancePersonDto = Bean.toPo(item, maintenancePersonDto);
maintenancePersonDto.setType(PERSON);
if (maintenancePersonDto.getParentId() != null) {
Long getParentId = Long.valueOf(item.getParentId().split("@")[1]);
maintenancePersonDto.setParentId(getParentId);
}
if(maintenanceCompanyService.checkPersonCodeExists(item.getCode())) {
maintenancePersonDto.setCode(item.getCode());
}else {
maintenancePersonDto.setCode(null);
}
maintenanceCompanyService.savePersonDetail(maintenancePersonDto, maintenancePersonDto.getParentId());
}
);
}
private void excelImportDutyPerson(MultipartFile multipartFile, String dutyType) throws Exception {
String fileName = multipartFile.getOriginalFilename(); String fileName = multipartFile.getOriginalFilename();
if (fileName == null) { if (fileName == null) {
......
...@@ -12,10 +12,12 @@ import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto; ...@@ -12,10 +12,12 @@ import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.DataDictionary; import com.yeejoin.amos.boot.module.common.api.entity.DataDictionary;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters; import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.ExcelSelectData; import com.yeejoin.amos.boot.module.common.api.enums.ExcelSelectData;
import com.yeejoin.amos.boot.module.common.api.excel.DataSources; import com.yeejoin.amos.boot.module.common.api.excel.DataSources;
import com.yeejoin.amos.boot.module.common.api.mapper.DataDictionaryMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.jcs.api.feign.EquipFeignClient;
...@@ -49,7 +51,9 @@ public class DataSourcesImpl implements DataSources { ...@@ -49,7 +51,9 @@ public class DataSourcesImpl implements DataSources {
@Autowired @Autowired
EquipFeignClient equipFeignClient; EquipFeignClient equipFeignClient;
@Autowired
IMaintenanceCompanyService maintenanceCompanyService;
@Autowired @Autowired
private RestTemplate restTemplate; private RestTemplate restTemplate;
...@@ -105,6 +109,8 @@ public class DataSourcesImpl implements DataSources { ...@@ -105,6 +109,8 @@ public class DataSourcesImpl implements DataSources {
case "getCarList": case "getCarList":
str = getCarList(); str = getCarList();
break; break;
case "getCompanyAndDeparementTree":
str= getCompanyAndDeparementTree();
} }
} }
return str; return str;
...@@ -210,5 +216,14 @@ public class DataSourcesImpl implements DataSources { ...@@ -210,5 +216,14 @@ public class DataSourcesImpl implements DataSources {
String[] str = names.toArray(new String[names.size()]); String[] str = names.toArray(new String[names.size()]);
return str; return str;
} }
private String[] getCompanyAndDeparementTree() throws Exception {
List<OrgMenuDto> menus = orgUsrService.getTree(null,
maintenanceCompanyService.getCompanyAndDepartmentTree(), MaintenanceCompany.class.getName(),
"getSequenceNbr", 2, "getName", "getParentId", "getType");
List<String> stringList = new ArrayList<String>();
initCompanyList(menus, stringList);
String[] str = stringList.toArray(new String[stringList.size()]);
return str;
}
} }
This diff is collapsed.
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