Commit 88a21fea authored by tangwei's avatar tangwei

修改bug

parent 325493de
......@@ -8,7 +8,7 @@ import lombok.Getter;
@AllArgsConstructor
public enum ExcelEnums {
CZXX ("场站信息", "场站信息", "com.yeejoin.amos.boot.module.jxiop.api.dto.ExStationBasicDto","CZXX"),
RYXX("人员信息", "人员信息", "com.yeejoin.amos.boot.module.jcs.api.dto.EXPersonUser","RYXX");
RYXX("人员信息", "人员信息", "com.yeejoin.amos.boot.module.jxiop.api.dto.EXPersonUser","RYXX");
private String fileName;
private String sheetName;
private String classUrl;
......
package com.yeejoin.amos.boot.module.jxiop.api.dto;
import com.yeejoin.amos.boot.biz.common.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.biz.common.excel.ExplicitConstraint;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
......@@ -106,7 +107,7 @@ public class EXPersonUser {
private String workPlaceKey;
@ExcelProperty(value = "岗位", index = 22)
@ExplicitConstraint(indexNum = 22, type="YGZYJNJDZS") //固定下拉内容
@ExplicitConstraint(indexNum = 22,sourceClass = CommonExplicitConstraint.class, type="YGZYJNJDZS") //固定下拉内容
@ApiModelProperty(value = "岗位")
private String postName;
......
......@@ -86,7 +86,7 @@
person_account.`name` name,
person_account.job_number jobNumber,
person_account.project_name projectName,
person_account.department_name departmentName,
person_account.project_department_name departmentName,
person_account.ID_type idType,
person_account.ID_number idNumber,
person_account.account_name accountName
......@@ -105,7 +105,7 @@
AND person_account.project_name like concat('%',#{projectName},'%')
</if>
<if test="orgCode != null and orgCode != ''">
AND person_basic.org_code like concat('%',#{orgCode},'%')
AND person_basic.project_org_code like concat('%',#{orgCode},'%')
</if>
</where>
......@@ -119,10 +119,10 @@
person_account.`name` name,
person_account.job_number jobNumber,
person_account.project_name projectName,
person_account.department_name departmentName,
person_account.project_department_name departmentName,
person_account.ID_type idType,
person_account.ID_number idNumber,
person_account.account_name accountName
person_account.account_name accountName,
person_basic.sex sex,
person_basic.birthday birthday,
person_basic.age age,
......@@ -178,7 +178,7 @@
AND person_account.project_name like concat('%',#{projectName},'%')
</if>
<if test="orgCode != null and orgCode != ''">
AND person_basic.org_code like concat('%',#{orgCode},'%')
AND person_basic.project_org_code like concat('%',#{orgCode},'%')
</if>
</where>
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.excel.DataSources;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
......@@ -22,19 +26,21 @@ public class ExDataSourcesImpl implements DataSources {
@Override
public String[] selectList(String type, String method) throws Exception {
String[] str = {};
switch (method) {
case "getArea":
str = getArea();
break;
if (StringUtils.isNotEmpty(type)) {
str = getDataDictionary(type);
} else {
switch (method) {
case "getArea":
str = getArea();
break;
}
}
return str;
}
private String[] getArea() {
FeignClientResult<Collection<CompanyModel>> de = Privilege.companyClient.queryAgencyTree(null);
// FeignClientResult<List<DictionarieValueModel>> lidt=Systemctl.dictionarieClient.dictValues(dictCode)
Collection<CompanyModel> listco = new ArrayList<>();
String[] str = null;
if (!ObjectUtils.isEmpty(de)) {
......@@ -82,5 +88,26 @@ public class ExDataSourcesImpl implements DataSources {
}
private String[] getDataDictionary(String type) {
List<String> collect =new ArrayList<>();
String[] str = null;
FeignClientResult<List<DictionarieValueModel>> de= Systemctl.dictionarieClient.dictValues(type);
List<DictionarieValueModel> listco=new ArrayList<>();
if (!ObjectUtils.isEmpty(de)) {
if (de.getStatus() == 200) {
listco = de.getResult();
for (DictionarieValueModel dictionarieValueModel : listco) {
collect.add(dictionarieValueModel.getDictDataValue());
}
str = collect.toArray(new String[collect.size()]);
} else {
throw new RuntimeException(de.getMessage());
}
}
return str;
}
}
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