Commit c170dd05 authored by 曹盼盼's avatar 曹盼盼

修改小程序设备详情

parent db9ad9d2
...@@ -24,7 +24,7 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.feign.IdxFeignService; ...@@ -24,7 +24,7 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.feign.IdxFeignService;
import com.yeejoin.amos.boot.module.tzs.flc.api.feign.PrivilegeFeginService; import com.yeejoin.amos.boot.module.tzs.flc.api.feign.PrivilegeFeginService;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import liquibase.pro.packaged.S;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope; import org.apache.http.auth.AuthScope;
......
...@@ -4,10 +4,13 @@ import com.alibaba.fastjson.JSON; ...@@ -4,10 +4,13 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.MybatisConfiguration; import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper; import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil; import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
...@@ -62,6 +65,7 @@ import java.security.AlgorithmParameters; ...@@ -62,6 +65,7 @@ import java.security.AlgorithmParameters;
import java.security.NoSuchProviderException; import java.security.NoSuchProviderException;
import java.security.Security; import java.security.Security;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import static com.mysql.cj.jdbc.interceptors.SessionAssociationInterceptor.getSessionKey; import static com.mysql.cj.jdbc.interceptors.SessionAssociationInterceptor.getSessionKey;
...@@ -71,6 +75,12 @@ public class TzsAppService { ...@@ -71,6 +75,12 @@ public class TzsAppService {
@Autowired @Autowired
DesignInfoService designInfoService; DesignInfoService designInfoService;
@Value("classpath:/json/equipCategory.json")
private Resource equipCategory;
@Autowired
DataDictionaryMapper dataDictionaryMapper;
@Autowired @Autowired
IdxFeignService idxFeignService; IdxFeignService idxFeignService;
...@@ -97,8 +107,7 @@ public class TzsAppService { ...@@ -97,8 +107,7 @@ public class TzsAppService {
@Autowired @Autowired
EquipTechParamLiftingService liftingService; EquipTechParamLiftingService liftingService;
@Value("classpath:/json/equipCategory.json")
private Resource equipCategory;
@Autowired @Autowired
EquipTechParamPipelineService pipelineService; EquipTechParamPipelineService pipelineService;
...@@ -175,6 +184,8 @@ public class TzsAppService { ...@@ -175,6 +184,8 @@ public class TzsAppService {
private final int successsCode = 200; private final int successsCode = 200;
public Map<String, Object> getEquipmentInfo(String record) { public Map<String, Object> getEquipmentInfo(String record) {
List<DataDictionary> dictionaryList = getDictionary();
List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(null);
Map<String, Object> map = new HashMap(); Map<String, Object> map = new HashMap();
map.put("SEQUENCE_NBR", record); map.put("SEQUENCE_NBR", record);
map.put("tableName", "idx_biz_view_jg_claim"); map.put("tableName", "idx_biz_view_jg_claim");
...@@ -189,8 +200,8 @@ public class TzsAppService { ...@@ -189,8 +200,8 @@ public class TzsAppService {
// 出厂 // 出厂
JSONObject exFactoryJsonObject = new JSONObject(); JSONObject exFactoryJsonObject = new JSONObject();
List exFactoryList = new ArrayList(); List exFactoryList = new ArrayList();
getGroupList(record, DesignInfo.class, DesignInfoModel.class, designInfoService, exFactoryList, false); getGroupList(record, DesignInfo.class, DesignInfoModel.class, designInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList(record, ProduceInfo.class, ProduceInfoModel.class, produceInfoService, exFactoryList, false); getGroupList(record, ProduceInfo.class, ProduceInfoModel.class, produceInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
exFactoryJsonObject.put("title", "出厂"); exFactoryJsonObject.put("title", "出厂");
exFactoryJsonObject.put("tabValue", exFactoryList); exFactoryJsonObject.put("tabValue", exFactoryList);
jsonArray.add(exFactoryJsonObject); jsonArray.add(exFactoryJsonObject);
...@@ -198,7 +209,7 @@ public class TzsAppService { ...@@ -198,7 +209,7 @@ public class TzsAppService {
// 施工 // 施工
JSONObject constructionJsonObject = new JSONObject(); JSONObject constructionJsonObject = new JSONObject();
List constructionList = new ArrayList(); List constructionList = new ArrayList();
getGroupList(record, ConstructionInfo.class, ConstructionInfoModel.class, constructionInfoService, constructionList, true); getGroupList(record, ConstructionInfo.class, ConstructionInfoModel.class, constructionInfoService, constructionList, true,dictionaryList,equipmentCategories);
constructionJsonObject.put("title", "施工"); constructionJsonObject.put("title", "施工");
constructionJsonObject.put("tabValue", constructionList); constructionJsonObject.put("tabValue", constructionList);
jsonArray.add(constructionJsonObject); jsonArray.add(constructionJsonObject);
...@@ -206,17 +217,17 @@ public class TzsAppService { ...@@ -206,17 +217,17 @@ public class TzsAppService {
// 注册 // 注册
JSONObject registrationJsonObject = new JSONObject(); JSONObject registrationJsonObject = new JSONObject();
List registrationList = new ArrayList(); List registrationList = new ArrayList();
getGroupList(record, RegistrationInfo.class, RegistrationInfoModel.class, registrationInfoService, registrationList, false); getGroupList(record, RegistrationInfo.class, RegistrationInfoModel.class, registrationInfoService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, EquipTechParamBoiler.class, EquipTechParamBoilerModel.class, boilerService, registrationList, false); getGroupList(record, EquipTechParamBoiler.class, EquipTechParamBoilerModel.class, boilerService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, EquipTechParamElevator.class, EquipTechParamElevatorModel.class, elevatorService, registrationList, false); getGroupList(record, EquipTechParamElevator.class, EquipTechParamElevatorModel.class, elevatorService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, EquipTechParamLifting.class, EquipTechParamLiftingModel.class, elevatorService, registrationList, false); getGroupList(record, EquipTechParamLifting.class, EquipTechParamLiftingModel.class, elevatorService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, EquipTechParamPipeline.class, EquipTechParamPipelineModel.class, pipelineService, registrationList, false); getGroupList(record, EquipTechParamPipeline.class, EquipTechParamPipelineModel.class, pipelineService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, EquipTechParamRides.class, EquipTechParamRidesModel.class, ridesService, registrationList, false); getGroupList(record, EquipTechParamRides.class, EquipTechParamRidesModel.class, ridesService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, EquipTechParamRopeway.class, EquipTechParamRopewayModel.class, ropewayService, registrationList, false); getGroupList(record, EquipTechParamRopeway.class, EquipTechParamRopewayModel.class, ropewayService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, EquipTechParamVehicle.class, EquipTechParamVehicleModel.class, vehicleService, registrationList, false); getGroupList(record, EquipTechParamVehicle.class, EquipTechParamVehicleModel.class, vehicleService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, EquipTechParamVessel.class, EquipTechParamVesselModel.class, vesselService, registrationList, false); getGroupList(record, EquipTechParamVessel.class, EquipTechParamVesselModel.class, vesselService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, MainParts.class, MainPartsModel.class, mainPartsService, registrationList, false); getGroupList(record, MainParts.class, MainPartsModel.class, mainPartsService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(record, ProtectionDevices.class, ProtectionDevicesModel.class, protectionDevicesService, registrationList, false); getGroupList(record, ProtectionDevices.class, ProtectionDevicesModel.class, protectionDevicesService, registrationList, false,dictionaryList,equipmentCategories);
registrationJsonObject.put("title", "注册"); registrationJsonObject.put("title", "注册");
registrationJsonObject.put("tabValue", registrationList); registrationJsonObject.put("tabValue", registrationList);
jsonArray.add(registrationJsonObject); jsonArray.add(registrationJsonObject);
...@@ -224,7 +235,7 @@ public class TzsAppService { ...@@ -224,7 +235,7 @@ public class TzsAppService {
// 使用 // 使用
JSONObject useJsonObject = new JSONObject(); JSONObject useJsonObject = new JSONObject();
List useList = new ArrayList(); List useList = new ArrayList();
getGroupList(record, UseInfo.class, UseInfoModel.class, unseInfoService, useList, false); getGroupList(record, UseInfo.class, UseInfoModel.class, unseInfoService, useList, false,dictionaryList,equipmentCategories);
useJsonObject.put("title", "使用"); useJsonObject.put("title", "使用");
useJsonObject.put("tabValue", useList); useJsonObject.put("tabValue", useList);
jsonArray.add(useJsonObject); jsonArray.add(useJsonObject);
...@@ -232,7 +243,7 @@ public class TzsAppService { ...@@ -232,7 +243,7 @@ public class TzsAppService {
// 维保 // 维保
JSONObject maintenanceJsonObject = new JSONObject(); JSONObject maintenanceJsonObject = new JSONObject();
List maintenanceList = new ArrayList(); List maintenanceList = new ArrayList();
getGroupList(record, MaintenanceInfo.class, MaintenanceInfoModel.class, maintenanceInfoService, maintenanceList, true); getGroupList(record, MaintenanceInfo.class, MaintenanceInfoModel.class, maintenanceInfoService, maintenanceList, true,dictionaryList,equipmentCategories);
maintenanceJsonObject.put("title", "维保"); maintenanceJsonObject.put("title", "维保");
maintenanceJsonObject.put("tabValue", maintenanceList); maintenanceJsonObject.put("tabValue", maintenanceList);
jsonArray.add(maintenanceJsonObject); jsonArray.add(maintenanceJsonObject);
...@@ -240,7 +251,7 @@ public class TzsAppService { ...@@ -240,7 +251,7 @@ public class TzsAppService {
// 检验 // 检验
JSONObject inspectionJsonObject = new JSONObject(); JSONObject inspectionJsonObject = new JSONObject();
List inspectionList = new ArrayList(); List inspectionList = new ArrayList();
getGroupList(record, InspectionDetectionInfo.class, InspectionDetectionInfoModel.class, inspectionDetectionInfoService, inspectionList, true); getGroupList(record, InspectionDetectionInfo.class, InspectionDetectionInfoModel.class, inspectionDetectionInfoService, inspectionList, true,dictionaryList,equipmentCategories);
inspectionJsonObject.put("title", "检验"); inspectionJsonObject.put("title", "检验");
inspectionJsonObject.put("tabValue", inspectionList); inspectionJsonObject.put("tabValue", inspectionList);
jsonArray.add(inspectionJsonObject); jsonArray.add(inspectionJsonObject);
...@@ -248,7 +259,7 @@ public class TzsAppService { ...@@ -248,7 +259,7 @@ public class TzsAppService {
// 其他 // 其他
JSONObject otherJsonObject = new JSONObject(); JSONObject otherJsonObject = new JSONObject();
List otherList = new ArrayList(); List otherList = new ArrayList();
getGroupList(record, OtherInfo.class, OtherInfoModel.class, otherInfoService, otherList, false); getGroupList(record, OtherInfo.class, OtherInfoModel.class, otherInfoService, otherList, false,dictionaryList,equipmentCategories);
otherJsonObject.put("title", "其他"); otherJsonObject.put("title", "其他");
otherJsonObject.put("tabValue", otherList); otherJsonObject.put("tabValue", otherList);
jsonArray.add(otherJsonObject); jsonArray.add(otherJsonObject);
...@@ -257,7 +268,7 @@ public class TzsAppService { ...@@ -257,7 +268,7 @@ public class TzsAppService {
return map; return map;
} }
public void getGroupList(String record, Class entity, Class dto, BaseService service, List list, boolean isOne) { public void getGroupList(String record, Class entity, Class dto, BaseService service, List list, boolean isOne,List<DataDictionary> dictionaryList,List<EquipmentCategory> equipmentCategories) {
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""), entity); TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""), entity);
QueryWrapper wrapper = new QueryWrapper(); QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("RECORD", record); wrapper.eq("RECORD", record);
...@@ -273,7 +284,7 @@ public class TzsAppService { ...@@ -273,7 +284,7 @@ public class TzsAppService {
if (entityList.size()>0) { if (entityList.size()>0) {
while (iterator.hasNext()) { while (iterator.hasNext()) {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(iterator.next())); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(iterator.next()));
result = getFieldList(dto, jsonObject, null); result = getFieldList(dto, jsonObject, null,dictionaryList,equipmentCategories);
list.add(result); list.add(result);
} }
...@@ -281,21 +292,23 @@ public class TzsAppService { ...@@ -281,21 +292,23 @@ public class TzsAppService {
} }
} else { } else {
if (entityList.size()>0) {
int count = entityList.size(); int count = entityList.size();
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(iterator.next())); JSONObject jsonObject = null;
result = getFieldList(dto, jsonObject, count); if (count>0) {
jsonObject= JSON.parseObject(JSON.toJSONString(iterator.next()));
}else {
jsonObject=new JSONObject();
}
result = getFieldList(dto, jsonObject, count,dictionaryList,equipmentCategories);
list.add(result); list.add(result);
}
} }
} }
public JSONObject getFieldList(Class clazz, JSONObject jsonObject, Integer count) { public JSONObject getFieldList(Class clazz, JSONObject jsonObject, Integer count,List<DataDictionary> dictionaryList,List<EquipmentCategory> equipmentCategories) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
JSONObject ApiModel = JSON.parseObject(JSON.toJSONString(clazz.getAnnotation(ApiModel.class))); JSONObject ApiModel = JSON.parseObject(JSON.toJSONString(clazz.getAnnotation(ApiModel.class)));
String groupName = ApiModel.getString("description"); String groupName = ApiModel.getString("description");
...@@ -306,17 +319,21 @@ public class TzsAppService { ...@@ -306,17 +319,21 @@ public class TzsAppService {
if (field.getAnnotation(ApiModelProperty.class) != null && !ValidationUtil.isEmpty(field.getAnnotation(ApiModelProperty.class).value())) { if (field.getAnnotation(ApiModelProperty.class) != null && !ValidationUtil.isEmpty(field.getAnnotation(ApiModelProperty.class).value())) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
String filedName = field.getAnnotation(ApiModelProperty.class).value(); String filedName = field.getAnnotation(ApiModelProperty.class).value();
// key和value可根据需求存 // key和value可根据需求存
// 这存的key为注解的值,value为类属性名 // 这存的key为注解的值,value为类属性名
map.put("fieldName", filedName); map.put("fieldName", filedName);
map.put("fieldValue", jsonObject.getString(field.getName()));
map.put("fieldKey", field.getName()); map.put("fieldKey", field.getName());
if (!ValidationUtil.isEmpty(jsonObject)) {
map.put("fieldValue", jsonObject.getString(field.getName()));
getCon(field.getName(),jsonObject,map,clazz,dictionaryList,equipmentCategories);
}else {
map.put("fieldValue", "");
}
list.add(map); list.add(map);
} }
} }
} }
// 整理出现多个附件的情况 // 整理出现多个附件的情况
Iterator<Map<String, Object>> iterator = list.iterator(); Iterator<Map<String, Object>> iterator = list.iterator();
JSONArray array = new JSONArray(); JSONArray array = new JSONArray();
...@@ -399,7 +416,6 @@ public class TzsAppService { ...@@ -399,7 +416,6 @@ public class TzsAppService {
} }
public Map<String, Object> login(MobileLoginParam param) { public Map<String, Object> login(MobileLoginParam param) {
Map<String, Object> result = new LinkedHashMap<>(); Map<String, Object> result = new LinkedHashMap<>();
IdPasswordAuthModel idPasswordAuthModel = new IdPasswordAuthModel(); IdPasswordAuthModel idPasswordAuthModel = new IdPasswordAuthModel();
idPasswordAuthModel.setLoginId(param.getPhoneNo()); idPasswordAuthModel.setLoginId(param.getPhoneNo());
...@@ -446,7 +462,6 @@ public class TzsAppService { ...@@ -446,7 +462,6 @@ public class TzsAppService {
@SneakyThrows @SneakyThrows
public JSONObject wxUserLogin(JSONObject wx) { public JSONObject wxUserLogin(JSONObject wx) {
JSONObject obj = getSessionKey(wx); JSONObject obj = getSessionKey(wx);
String sessionKey = obj.getString("session_key"); String sessionKey = obj.getString("session_key");
//被加密的数据 //被加密的数据
...@@ -464,7 +479,6 @@ public class TzsAppService { ...@@ -464,7 +479,6 @@ public class TzsAppService {
Arrays.fill(temp, (byte) 0); Arrays.fill(temp, (byte) 0);
System.arraycopy(keyByte, 0, temp, 0, keyByte.length); System.arraycopy(keyByte, 0, temp, 0, keyByte.length);
keyByte = temp; keyByte = temp;
} }
// 初始化 // 初始化
Security.addProvider(new BouncyCastleProvider()); Security.addProvider(new BouncyCastleProvider());
...@@ -559,4 +573,111 @@ public class TzsAppService { ...@@ -559,4 +573,111 @@ public class TzsAppService {
} }
return jsonArray; return jsonArray;
} }
//查询字典值(只针对设备一码通详情字典,其他勿用)
public List<DataDictionary> getDictionary(){
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>();
wrapper.ge(DataDictionary::getSequenceNbr ,5951L).le(DataDictionary::getSequenceNbr ,6529L);
List<DataDictionary> dataDictionaryList = dataDictionaryMapper.selectList(wrapper);
return dataDictionaryList;
}
public void getCon(String fileName,JSONObject jsonObject,Map<String, Object> map,Class clazz,List<DataDictionary> dictionaryList,List<EquipmentCategory> equipmentCategories) {
if ("province".indexOf(fileName) != -1 || "city".indexOf(fileName) != -1 || "county".indexOf(fileName) != -1) {
JSONArray regionName = getRegionName();
List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(),RegionModel.class);
for (RegionModel re : list) {
if (re.getRegionCode().equals(Integer.valueOf(jsonObject.getString(fileName)))) {
map.put("fieldValue", re.getRegionName());
}
}
}
if ("designStandard".indexOf(fileName) !=-1) {
JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString(fileName));
map.put("fieldValue", jsonArray);
}
getIf("imported",fileName,"BOOLEN",dictionaryList,jsonObject,map);
getIf("changes",fileName,"BGSX",dictionaryList,jsonObject,map);
getIf("usePlace",fileName,"ADDRESS",dictionaryList,jsonObject,map);
getIf("equManageDt",fileName,"ZGBM",dictionaryList,jsonObject,map);
getIf("equState",fileName,"SHZT",dictionaryList,jsonObject,map);
getIf("denselyPopulatedAreas",fileName,"BOOLEN",dictionaryList,jsonObject,map);
getIf("importantPlaces",fileName,"BOOLEN",dictionaryList,jsonObject,map);
getIf("registerState",fileName,"ZC",dictionaryList,jsonObject,map);
getIf("inspectType",fileName,"JYLX",dictionaryList,jsonObject,map);
getIf("inspectConclusion",fileName,"JYJL",dictionaryList,jsonObject,map);
getIf("constructionType",fileName,"SGLX",dictionaryList,jsonObject,map);
for (EquipmentCategory equipmentCategory : equipmentCategories) {
if ("equDefine".indexOf(fileName) != -1 && !ValidationUtil.isEmpty(equipmentCategory) && !ValidationUtil.isEmpty(equipmentCategory.getCode()) &&
!ValidationUtil.isEmpty(fileName) && !ValidationUtil.isEmpty(jsonObject.getString(fileName)) && equipmentCategory.getCode().indexOf(jsonObject.getString(fileName)) !=-1) {
map.put("fieldValue",equipmentCategory.getName() );
}
if ("equCategory".indexOf(fileName) != -1 && !ValidationUtil.isEmpty(equipmentCategory) && !ValidationUtil.isEmpty(equipmentCategory.getCode()) &&
!ValidationUtil.isEmpty(fileName) && !ValidationUtil.isEmpty(jsonObject.getString(fileName)) && equipmentCategory.getCode().indexOf(jsonObject.getString(fileName)) !=-1) {
map.put("fieldValue",equipmentCategory.getName() );
}
}
getIf("carrierLine",fileName,"YZS",dictionaryList,jsonObject,map);
getIf("deviceLevel",fileName,"GLJB",dictionaryList,jsonObject,map);
getIf("fuelType",fileName,"GLZL",dictionaryList,jsonObject,map);
getIf("nameOfPressureParts",fileName,"GLBJMC",dictionaryList,jsonObject,map);
getIf("nonDestructiveTestingMethodsForPressureParts",fileName,"GLWSJCFF",dictionaryList,jsonObject,map);
getIf("qpLossless",fileName,"RQJCFF",dictionaryList,jsonObject,map);
getIf("glLossless",fileName,"RQJCFF",dictionaryList,jsonObject,map);
getIf("mainStructureType",fileName,"RQJG",dictionaryList,jsonObject,map);
getIf("checkLossless",fileName,"RQJCFF",dictionaryList,jsonObject,map);
getIf("pipelineClass",fileName,"GDLB",dictionaryList,jsonObject,map);
getIf("deviceLevel",fileName,"GBI",dictionaryList,jsonObject,map);
getIf("workLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("mainStructureType",fileName,"JGS",dictionaryList,jsonObject,map);
getIf("luffingMode",fileName,"BFFS",dictionaryList,jsonObject,map);
getIf("towerStandardType",fileName,"JXS",dictionaryList,jsonObject,map);
getIf("baseType",fileName,"JZXS",dictionaryList,jsonObject,map);
getIf("outriggerType",fileName,"ZT",dictionaryList,jsonObject,map);
getIf("mainBeamType",fileName,"ZLXS",dictionaryList,jsonObject,map);
getIf("boomType",fileName,"BJXS",dictionaryList,jsonObject,map);
getIf("boomStructureType",fileName,"BJJGXS",dictionaryList,jsonObject,map);
getIf("gantryStructureType",fileName,"MJJG",dictionaryList,jsonObject,map);
getIf("use",fileName,"YT",dictionaryList,jsonObject,map);
getIf("controlMode",fileName,"CZFS",dictionaryList,jsonObject,map);
getIf("hangingCagesNumber",fileName,"DLSL",dictionaryList,jsonObject,map);
getIf("driveMechanismType",fileName,"QDJG",dictionaryList,jsonObject,map);
getIf("guideRailFrame",fileName,"DS",dictionaryList,jsonObject,map);
getIf("liftingDriveMode",fileName,"QD",dictionaryList,jsonObject,map);
getIf("operationMode",fileName,"JXCZ",dictionaryList,jsonObject,map);
getIf("liftingMode",fileName,"QSFS",dictionaryList,jsonObject,map);
getIf("explosionProofGrade",fileName,"FBDJ",dictionaryList,jsonObject,map);
getIf("hoistWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("bigcarTraveWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("smallcarTraveWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("hoistWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("smallcarSideswayWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("partName",fileName,"ZYLBJ",dictionaryList,jsonObject,map);
getIf("workType",fileName,"GZLX",dictionaryList,jsonObject,map);
getIf("controlMode",fileName,"KZFS",dictionaryList,jsonObject,map);
getIf("jackingType",fileName,"DSXS",dictionaryList,jsonObject,map);
getIf("explosionproofType",fileName,"FBXS",dictionaryList,jsonObject,map);
getIf("explosionproofGrade",fileName,"FBDJ",dictionaryList,jsonObject,map);
getIf("xgxlMediaType",fileName,"XGJZZL",dictionaryList,jsonObject,map);
getIf("designation",fileName,"KYSDBJMC",dictionaryList,jsonObject,map);
getIf("designation",fileName,"CCFJDCLLBJMC",dictionaryList,jsonObject,map);
getIf("isMonitor",fileName,"HAVE",dictionaryList,jsonObject,map);
if ("equList".indexOf(fileName) !=-1) {
String equList = EquipmentClassifityEnum.getName.get(jsonObject.getString(fileName));
map.put("fieldValue", equList);
}
}
public void getIf(String name,String fileName,String type,List<DataDictionary> dictionaryList,JSONObject jsonObject,Map<String, Object> map){
if (name.indexOf(fileName) != -1) {
List<DataDictionary> list = dictionaryList.stream().filter(t -> t.getType().equals(type) && t.getCode().equals(jsonObject.getString(fileName))).collect(Collectors.toList());
if (list.size()>0) {
map.put("fieldValue", list.get(0).getName());
}
}
}
} }
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