Commit 17439dc8 authored by tianbo's avatar tianbo

Merge branch 'develop_tzs_ymt' into develop_tzs_register

parents a27df97d 9c605f0c
...@@ -24,25 +24,25 @@ public class RedissonManager { ...@@ -24,25 +24,25 @@ public class RedissonManager {
/** /**
* 公共-密码 * 公共-密码
*/ */
@Value("${spring.redis.password}") @Value("${spring.redis.password:default}")
private String password; private String password;
/** /**
* 单机环境使用 * 单机环境使用
*/ */
@Value("${spring.redis.host}") @Value("${spring.redis.host:default}")
private String host; private String host;
/** /**
* 单机环境使用 * 单机环境使用
*/ */
@Value("${spring.redis.port}") @Value("${spring.redis.port:6379}")
private String port; private String port;
/** /**
* 单机环境使用 * 单机环境使用
*/ */
@Value("${spring.redis.database}") @Value("${spring.redis.database:0}")
private int database; private int database;
@Bean @Bean
......
...@@ -62,6 +62,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -62,6 +62,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset; import java.time.ZoneOffset;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -864,7 +865,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -864,7 +865,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
private long calculateExpirationTime() { private long calculateExpirationTime() {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
LocalDateTime nextDay = now.plus(1, ChronoUnit.DAYS).withHour(0).withMinute(0).withSecond(0).withNano(0); LocalDateTime nextDay = now.plus(1, ChronoUnit.DAYS).withHour(0).withMinute(0).withSecond(0).withNano(0);
return nextDay.toInstant(ZoneOffset.of("+0")).toEpochMilli(); return nextDay.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
} }
......
...@@ -88,12 +88,12 @@ public class TzsCitInfoServiceImpl extends BaseService<TzsCitInfoDto, TzsCitInfo ...@@ -88,12 +88,12 @@ public class TzsCitInfoServiceImpl extends BaseService<TzsCitInfoDto, TzsCitInfo
return massage; return massage;
} }
} }
if(!extphone.equals(tzsCitInfo.getExtphone())) { // if(!extphone.equals(tzsCitInfo.getExtphone())) {
if (!ValidationUtil.isEmpty(this.list(new LambdaQueryWrapper<TzsCitInfo>().eq(TzsCitInfo::getExtphone, tzsCitInfo.getExtphone())))) { // if (!ValidationUtil.isEmpty(this.list(new LambdaQueryWrapper<TzsCitInfo>().eq(TzsCitInfo::getExtphone, tzsCitInfo.getExtphone())))) {
massage = "登录坐席参数extphone已存在,不可重复添加!"; // massage = "登录坐席参数extphone已存在,不可重复添加!";
return massage; // return massage;
} // }
} // }
//保存数据 //保存数据
if(!ValidationUtil.isEmpty(tzsCitInfo.getCtiUserId())) { if(!ValidationUtil.isEmpty(tzsCitInfo.getCtiUserId())) {
......
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "OtherEquBaseInfoForWXModel", description = "")
public class CylinderEquBaseInfoForWXModel extends EquipTechParamBoilerModel{
@ApiModelProperty(value = "气瓶充装介M质")
private String fillingMedium;
@ApiModelProperty(value = "充装量")
private String fillingCapacity;
@ApiModelProperty(value = "最近一次充装时间")
private String lastFillingTime;
@ApiModelProperty(value = "使用期限")
private String termOfUse;
}
...@@ -6,32 +6,17 @@ import lombok.Data; ...@@ -6,32 +6,17 @@ import lombok.Data;
@Data @Data
@ApiModel(value = "ElevatorBaseInfoForWXModel", description = "") @ApiModel(value = "ElevatorBaseInfoForWXModel", description = "")
public class ElevatorBaseInfoForWXModel { public class ElevatorBaseInfoForWXModel extends EquBaseInfoForWXModel{
@ApiModelProperty(value = "电梯识别码") @ApiModelProperty(value = "电梯识别码")
private String code96333; private String code96333;
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "制造单位名") @ApiModelProperty(value = "制造单位名")
private String produceUnitName; private String produceUnitName;
@ApiModelProperty(value = "出厂编号") @ApiModelProperty(value = "出厂编号")
private String factoryNum; private String factoryNum;
@ApiModelProperty(value = "所属区域")
private String area;
@ApiModelProperty(value = "使用地址") @ApiModelProperty(value = "使用地址")
private String address; private String address;
@ApiModelProperty(value = "单位内编号")
private String intraUnitNumber;
} }
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "EquBaseInfoForWXModel", description = "")
public class EquBaseInfoForWXModel {
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "所属区域")
private String county;
@ApiModelProperty(value = "单位内编号")
private String intraUnitNumber;
}
...@@ -6,30 +6,11 @@ import lombok.Data; ...@@ -6,30 +6,11 @@ import lombok.Data;
@Data @Data
@ApiModel(value = "OtherEquBaseInfoForWXModel", description = "") @ApiModel(value = "OtherEquBaseInfoForWXModel", description = "")
public class OtherEquBaseInfoForWXModel { public class OtherEquBaseInfoForWXModel extends EquBaseInfoForWXModel{
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "制造单位名") @ApiModelProperty(value = "制造单位名")
private String produceUnitName; private String produceUnitName;
@ApiModelProperty(value = "出厂编号") @ApiModelProperty(value = "出厂编号")
private String factoryNum; private String factoryNum;
@ApiModelProperty(value = "所属区域")
private String area;
@ApiModelProperty(value = "使用地址")
private String address;
@ApiModelProperty(value = "单位内编号")
private String intraUnitNumber;
} }
...@@ -11,7 +11,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -11,7 +11,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@FeignClient(value = "AMOS-IDX", path = "idx", configuration = {FeignConfiguration.class}) @FeignClient(value = "AMOS-IDX", path = "idx", configuration =
{FeignConfiguration.class})
public interface IdxFeignService { public interface IdxFeignService {
@RequestMapping("/dimensionTable/getTreeChildIds") @RequestMapping("/dimensionTable/getTreeChildIds")
......
...@@ -8,14 +8,57 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -8,14 +8,57 @@ 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.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper; 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.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.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.app.api.common.CommonException; import com.yeejoin.amos.boot.module.app.api.common.CommonException;
import com.yeejoin.amos.boot.module.app.api.common.MobileLoginParam; import com.yeejoin.amos.boot.module.app.api.common.MobileLoginParam;
import com.yeejoin.amos.boot.module.app.api.dto.*; import com.yeejoin.amos.boot.module.app.api.dto.ConstructionInfoModel;
import com.yeejoin.amos.boot.module.app.api.entity.*; import com.yeejoin.amos.boot.module.app.api.dto.CylinderEquBaseInfoForWXModel;
import com.yeejoin.amos.boot.module.app.api.dto.DesignInfoModel;
import com.yeejoin.amos.boot.module.app.api.dto.ElevatorBaseInfoForWXModel;
import com.yeejoin.amos.boot.module.app.api.dto.EquBaseInfoForWXModel;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamBoilerModel;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamElevatorModel;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamLiftingModel;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamPipelineModel;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamRidesModel;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamRopewayModel;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamVehicleModel;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamVesselModel;
import com.yeejoin.amos.boot.module.app.api.dto.InspectionDetectionInfoModel;
import com.yeejoin.amos.boot.module.app.api.dto.InspectionDetectionInfoModelForWX;
import com.yeejoin.amos.boot.module.app.api.dto.MainPartsModel;
import com.yeejoin.amos.boot.module.app.api.dto.MaintenanceInfoModel;
import com.yeejoin.amos.boot.module.app.api.dto.MaintenanceInfoModelForWX;
import com.yeejoin.amos.boot.module.app.api.dto.OtherEquBaseInfoForWXModel;
import com.yeejoin.amos.boot.module.app.api.dto.OtherInfoModel;
import com.yeejoin.amos.boot.module.app.api.dto.ProduceInfoModel;
import com.yeejoin.amos.boot.module.app.api.dto.ProtectionDevicesModel;
import com.yeejoin.amos.boot.module.app.api.dto.RegistrationInfoModel;
import com.yeejoin.amos.boot.module.app.api.dto.UseInfoModel;
import com.yeejoin.amos.boot.module.app.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.app.api.entity.ConstructionInfo;
import com.yeejoin.amos.boot.module.app.api.entity.DesignInfo;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamBoiler;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamElevator;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamLifting;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamPipeline;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamRides;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamRopeway;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamVehicle;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamVessel;
import com.yeejoin.amos.boot.module.app.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.app.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.app.api.entity.MainParts;
import com.yeejoin.amos.boot.module.app.api.entity.MaintenanceInfo;
import com.yeejoin.amos.boot.module.app.api.entity.OtherInfo;
import com.yeejoin.amos.boot.module.app.api.entity.ProduceInfo;
import com.yeejoin.amos.boot.module.app.api.entity.ProtectionDevices;
import com.yeejoin.amos.boot.module.app.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.app.api.entity.UseInfo;
import com.yeejoin.amos.boot.module.app.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.app.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.app.api.mapper.CategoryOtherInfoMapper; import com.yeejoin.amos.boot.module.app.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.app.api.mapper.EquipmentCategoryMapper;
...@@ -23,7 +66,6 @@ import com.yeejoin.amos.boot.module.app.api.mapper.ViewJgClaimMapper; ...@@ -23,7 +66,6 @@ import com.yeejoin.amos.boot.module.app.api.mapper.ViewJgClaimMapper;
import com.yeejoin.amos.boot.module.app.biz.utils.HttpUtils; import com.yeejoin.amos.boot.module.app.biz.utils.HttpUtils;
import com.yeejoin.amos.boot.module.app.biz.utils.JsonUtils; import com.yeejoin.amos.boot.module.app.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.app.flc.api.feign.IdxFeignService; import com.yeejoin.amos.boot.module.app.flc.api.feign.IdxFeignService;
import com.yeejoin.amos.boot.module.app.flc.api.mapper.RegUnitInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -59,734 +101,734 @@ import java.io.InputStream; ...@@ -59,734 +101,734 @@ import java.io.InputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.security.AlgorithmParameters; import java.security.AlgorithmParameters;
import java.security.Security; import java.security.Security;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@Slf4j @Slf4j
public class TzsAppService { public class TzsAppService {
@Autowired /**
DesignInfoService designInfoService; * 产品appkey
*/
@Value("classpath:/json/equipCategory.json") private static final String appKey = "AMOS_STUDIO";
private Resource equipCategory; /**
* 产品product
@Autowired */
DataDictionaryMapper dataDictionaryMapper; private static final String product = "AMOS_STUDIO_WEB";
private static final String regionRedis = "app_region_redis";
@Autowired private final int successsCode = 200;
IdxFeignService idxFeignService; @Autowired
DesignInfoService designInfoService;
@Autowired @Autowired
EquipmentCategoryMapper equipmentCategoryMapper; DataDictionaryMapper dataDictionaryMapper;
@Autowired
@Autowired IdxFeignService idxFeignService;
EquipmentCategoryServiceImpl equipmentCategoryServiceImpl; @Autowired
@Autowired EquipmentCategoryMapper equipmentCategoryMapper;
ProduceInfoService produceInfoService; @Autowired
EquipmentCategoryServiceImpl equipmentCategoryServiceImpl;
@Autowired @Autowired
ConstructionInfoService constructionInfoService; ProduceInfoService produceInfoService;
@Autowired
@Autowired ConstructionInfoService constructionInfoService;
RegistrationInfoService registrationInfoService; @Autowired
RegistrationInfoService registrationInfoService;
@Autowired @Autowired
EquipTechParamBoilerService boilerService; EquipTechParamBoilerService boilerService;
@Autowired
@Autowired EquipTechParamElevatorService elevatorService;
EquipTechParamElevatorService elevatorService; @Autowired
EquipTechParamLiftingService liftingService;
@Autowired @Autowired
EquipTechParamLiftingService liftingService; EquipTechParamPipelineService pipelineService;
@Autowired
EquipTechParamRidesService ridesService;
@Autowired
@Autowired EquipTechParamRopewayService ropewayService;
EquipTechParamPipelineService pipelineService; @Autowired
EquipTechParamVehicleService vehicleService;
@Autowired @Autowired
EquipTechParamRidesService ridesService; EquipTechParamVesselService vesselService;
@Autowired
@Autowired MainPartsServiceImpl mainPartsService;
EquipTechParamRopewayService ropewayService; @Autowired
ProtectionDevicesServiceImpl protectionDevicesService;
@Autowired @Autowired
EquipTechParamVehicleService vehicleService; UseInfoService unseInfoService;
@Autowired
@Autowired MaintenanceInfoService maintenanceInfoService;
EquipTechParamVesselService vesselService; @Autowired
InspectionDetectionInfoServiceImpl inspectionDetectionInfoService;
@Autowired @Autowired
MainPartsServiceImpl mainPartsService; OtherInfoService otherInfoService;
@Autowired
@Autowired CategoryOtherInfoMapper categoryOtherInfoMapper;
ProtectionDevicesServiceImpl protectionDevicesService; @Autowired
RedisUtils redisUtils;
@Autowired @Value("${tzs.WxApp.appId}")
UseInfoService unseInfoService; String WxAppAppId;
@Value("${tzs.WxApp.secret}")
@Autowired String WxAppSecret;
MaintenanceInfoService maintenanceInfoService; @Value("${tzs.WxApp.grant-type}")
String WxAppGrantType;
@Autowired @Value("${minio.url.path}")
InspectionDetectionInfoServiceImpl inspectionDetectionInfoService; String minioPath;
@Autowired
@Autowired ViewJgClaimMapper viewJgClaimMapper;
OtherInfoService otherInfoService; @Value("classpath:/json/equipCategory.json")
private Resource equipCategory;
@Autowired public Map<String, Object> getEquipmentInfo(String record) {
CategoryOtherInfoMapper categoryOtherInfoMapper; List<DataDictionary> dictionaryList = getDictionary();
List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(null);
@Autowired Map<String, Object> map = new HashMap();
RedisUtils redisUtils; map.put("SEQUENCE_NBR", record);
map.put("tableName", "idx_biz_view_jg_claim");
@Value("${tzs.WxApp.appId}") ResponseModel<Page<Map<String, Object>>> model = idxFeignService.getPage(map);
String WxAppAppId ; List<Map<String, Object>> detailMapList = model.getResult().getRecords();
if (!ValidationUtil.isEmpty(detailMapList)) {
@Value("${tzs.WxApp.secret}") map = detailMapList.iterator().next();
String WxAppSecret; }
map.putAll(getQRCode(record));
@Value("${tzs.WxApp.grant-type}")
String WxAppGrantType; JSONArray jsonArray = new JSONArray();
// 出厂
@Value("${minio.url.path}") JSONObject exFactoryJsonObject = new JSONObject();
String minioPath; List exFactoryList = new ArrayList();
@Autowired getGroupList(null, record, DesignInfo.class, DesignInfoModel.class, designInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
private RegUnitInfoMapper regUnitInfoMapper; getGroupList(null, record, ProduceInfo.class, ProduceInfoModel.class, produceInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
@Autowired exFactoryJsonObject.put("title", "出厂");
ViewJgClaimMapper viewJgClaimMapper; exFactoryJsonObject.put("tabValue", exFactoryList);
public static final String WXUSER_TOKEN = "wxUser_token"; jsonArray.add(exFactoryJsonObject);
/** // 施工
* token 过期时间,wechat 系统为7200 ,tzs 系统小于7200 防止获取到无效token JSONObject constructionJsonObject = new JSONObject();
*/ List constructionList = new ArrayList();
private long time = 6000l; getGroupList(null, record, ConstructionInfo.class, ConstructionInfoModel.class, constructionInfoService, constructionList, true, dictionaryList, equipmentCategories);
constructionJsonObject.put("title", "施工");
/** constructionJsonObject.put("tabValue", constructionList);
* 产品appkey jsonArray.add(constructionJsonObject);
*/
private static final String appKey = "AMOS_STUDIO"; // 注册
/** JSONObject registrationJsonObject = new JSONObject();
* 产品product List registrationList = new ArrayList();
*/ getGroupList(null, record, RegistrationInfo.class, RegistrationInfoModel.class, registrationInfoService, registrationList, false, dictionaryList, equipmentCategories);
private static final String product = "AMOS_STUDIO_WEB"; getGroupList(null, record, EquipTechParamBoiler.class, EquipTechParamBoilerModel.class, boilerService, registrationList, false, dictionaryList, equipmentCategories);
private static final String regionRedis="app_region_redis"; getGroupList(null, record, EquipTechParamElevator.class, EquipTechParamElevatorModel.class, elevatorService, registrationList, false, dictionaryList, equipmentCategories);
getGroupList(null, record, EquipTechParamLifting.class, EquipTechParamLiftingModel.class, elevatorService, registrationList, false, dictionaryList, equipmentCategories);
private final int successsCode = 200; getGroupList(null, record, EquipTechParamPipeline.class, EquipTechParamPipelineModel.class, pipelineService, registrationList, false, dictionaryList, equipmentCategories);
getGroupList(null, record, EquipTechParamRides.class, EquipTechParamRidesModel.class, ridesService, registrationList, false, dictionaryList, equipmentCategories);
public Map<String, Object> getEquipmentInfo(String record) { getGroupList(null, record, EquipTechParamRopeway.class, EquipTechParamRopewayModel.class, ropewayService, registrationList, false, dictionaryList, equipmentCategories);
List<DataDictionary> dictionaryList = getDictionary(); getGroupList(null, record, EquipTechParamVehicle.class, EquipTechParamVehicleModel.class, vehicleService, registrationList, false, dictionaryList, equipmentCategories);
List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(null); getGroupList(null, record, EquipTechParamVessel.class, EquipTechParamVesselModel.class, vesselService, registrationList, false, dictionaryList, equipmentCategories);
Map<String, Object> map = new HashMap(); getGroupList(null, record, MainParts.class, MainPartsModel.class, mainPartsService, registrationList, false, dictionaryList, equipmentCategories);
map.put("SEQUENCE_NBR", record); getGroupList(null, record, ProtectionDevices.class, ProtectionDevicesModel.class, protectionDevicesService, registrationList, false, dictionaryList, equipmentCategories);
map.put("tableName", "idx_biz_view_jg_claim"); registrationJsonObject.put("title", "注册");
ResponseModel<Page<Map<String, Object>>> model=idxFeignService.getPage(map); registrationJsonObject.put("tabValue", registrationList);
List<Map<String, Object>> detialMapList = model.getResult().getRecords(); jsonArray.add(registrationJsonObject);
if (!ValidationUtil.isEmpty(detialMapList)) {
map = detialMapList.iterator().next(); // 使用
} JSONObject useJsonObject = new JSONObject();
map.putAll(getQRCode(record)); List useList = new ArrayList();
getGroupList(null, record, UseInfo.class, UseInfoModel.class, unseInfoService, useList, false, dictionaryList, equipmentCategories);
JSONArray jsonArray = new JSONArray(); useJsonObject.put("title", "使用");
// 出厂 useJsonObject.put("tabValue", useList);
JSONObject exFactoryJsonObject = new JSONObject(); jsonArray.add(useJsonObject);
List exFactoryList = new ArrayList();
getGroupList(null ,record, DesignInfo.class, DesignInfoModel.class, designInfoService, exFactoryList, false,dictionaryList,equipmentCategories); // 维保
getGroupList(null ,record, ProduceInfo.class, ProduceInfoModel.class, produceInfoService, exFactoryList, false,dictionaryList,equipmentCategories); JSONObject maintenanceJsonObject = new JSONObject();
exFactoryJsonObject.put("title", "出厂"); List maintenanceList = new ArrayList();
exFactoryJsonObject.put("tabValue", exFactoryList); getGroupList(null, record, MaintenanceInfo.class, MaintenanceInfoModel.class, maintenanceInfoService, maintenanceList, true, dictionaryList, equipmentCategories);
jsonArray.add(exFactoryJsonObject); maintenanceJsonObject.put("title", "维保");
maintenanceJsonObject.put("tabValue", maintenanceList);
// 施工 jsonArray.add(maintenanceJsonObject);
JSONObject constructionJsonObject = new JSONObject();
List constructionList = new ArrayList(); // 检验
getGroupList(null ,record, ConstructionInfo.class, ConstructionInfoModel.class, constructionInfoService, constructionList, true,dictionaryList,equipmentCategories); JSONObject inspectionJsonObject = new JSONObject();
constructionJsonObject.put("title", "施工"); List inspectionList = new ArrayList();
constructionJsonObject.put("tabValue", constructionList); getGroupList(null, record, InspectionDetectionInfo.class, InspectionDetectionInfoModel.class, inspectionDetectionInfoService, inspectionList, true, dictionaryList, equipmentCategories);
jsonArray.add(constructionJsonObject); inspectionJsonObject.put("title", "检验");
inspectionJsonObject.put("tabValue", inspectionList);
// 注册 jsonArray.add(inspectionJsonObject);
JSONObject registrationJsonObject = new JSONObject();
List registrationList = new ArrayList(); // 其他
getGroupList(null ,record, RegistrationInfo.class, RegistrationInfoModel.class, registrationInfoService, registrationList, false,dictionaryList,equipmentCategories); JSONObject otherJsonObject = new JSONObject();
getGroupList(null ,record, EquipTechParamBoiler.class, EquipTechParamBoilerModel.class, boilerService, registrationList, false,dictionaryList,equipmentCategories); List otherList = new ArrayList();
getGroupList(null ,record, EquipTechParamElevator.class, EquipTechParamElevatorModel.class, elevatorService, registrationList, false,dictionaryList,equipmentCategories); getGroupList(null, record, OtherInfo.class, OtherInfoModel.class, otherInfoService, otherList, false, dictionaryList, equipmentCategories);
getGroupList(null ,record, EquipTechParamLifting.class, EquipTechParamLiftingModel.class, elevatorService, registrationList, false,dictionaryList,equipmentCategories); otherJsonObject.put("title", "其他");
getGroupList(null ,record, EquipTechParamPipeline.class, EquipTechParamPipelineModel.class, pipelineService, registrationList, false,dictionaryList,equipmentCategories); otherJsonObject.put("tabValue", otherList);
getGroupList(null ,record, EquipTechParamRides.class, EquipTechParamRidesModel.class, ridesService, registrationList, false,dictionaryList,equipmentCategories); jsonArray.add(otherJsonObject);
getGroupList(null ,record, EquipTechParamRopeway.class, EquipTechParamRopewayModel.class, ropewayService, registrationList, false,dictionaryList,equipmentCategories); map.put("tab", jsonArray);
getGroupList(null ,record, EquipTechParamVehicle.class, EquipTechParamVehicleModel.class, vehicleService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, EquipTechParamVessel.class, EquipTechParamVesselModel.class, vesselService, registrationList, false,dictionaryList,equipmentCategories); return map;
getGroupList(null ,record, MainParts.class, MainPartsModel.class, mainPartsService, registrationList, false,dictionaryList,equipmentCategories); }
getGroupList(null ,record, ProtectionDevices.class, ProtectionDevicesModel.class, protectionDevicesService, registrationList, false,dictionaryList,equipmentCategories);
registrationJsonObject.put("title", "注册"); public Map<String, Object> getEquipmentInfoWX(String record) {
registrationJsonObject.put("tabValue", registrationList); List<DataDictionary> dictionaryList = getDictionary();
jsonArray.add(registrationJsonObject); List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(null);
Map<String, Object> map = new HashMap();
// 使用 map.put("SEQUENCE_NBR", record);
JSONObject useJsonObject = new JSONObject(); map.put("tableName", "idx_biz_view_jg_claim");
List useList = new ArrayList(); ResponseModel<Page<Map<String, Object>>> model = idxFeignService.getPage(map);
getGroupList(null ,record, UseInfo.class, UseInfoModel.class, unseInfoService, useList, false,dictionaryList,equipmentCategories); List<Map<String, Object>> detailMapList = model.getResult().getRecords();
useJsonObject.put("title", "使用"); if (!ValidationUtil.isEmpty(detailMapList)) {
useJsonObject.put("tabValue", useList); map = detailMapList.iterator().next();
jsonArray.add(useJsonObject); }
map.putAll(getQRCode(record));
// 维保
JSONObject maintenanceJsonObject = new JSONObject(); JSONArray jsonArray = new JSONArray();
List maintenanceList = new ArrayList(); JSONObject exFactoryJsonObject = new JSONObject();
getGroupList(null ,record, MaintenanceInfo.class, MaintenanceInfoModel.class, maintenanceInfoService, maintenanceList, true,dictionaryList,equipmentCategories); List exFactoryList = new ArrayList();
maintenanceJsonObject.put("title", "维保"); HashMap putMap = new HashMap();
maintenanceJsonObject.put("tabValue", maintenanceList); Field[] fields = EquBaseInfoForWXModel.class.getDeclaredFields();
jsonArray.add(maintenanceJsonObject); for (Field f : fields) {
putMap.put(f.getName(), "");
// 检验 }
JSONObject inspectionJsonObject = new JSONObject(); if (EquipmentClassifityEnum.DT.getCode().equals(map.get("EQU_LIST_CODE"))) {
List inspectionList = new ArrayList(); // 基本信息
getGroupList(null ,record, InspectionDetectionInfo.class, InspectionDetectionInfoModel.class, inspectionDetectionInfoService, inspectionList, true,dictionaryList,equipmentCategories); Field[] fields1 = ElevatorBaseInfoForWXModel.class.getDeclaredFields();
inspectionJsonObject.put("title", "检验"); for (Field f : fields1) {
inspectionJsonObject.put("tabValue", inspectionList); putMap.put(f.getName(), "");
jsonArray.add(inspectionJsonObject); }
// 其他 getGroupList(putMap, record, RegistrationInfo.class, ElevatorBaseInfoForWXModel.class, registrationInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
JSONObject otherJsonObject = new JSONObject(); getGroupList(putMap, record, DesignInfo.class, ElevatorBaseInfoForWXModel.class, designInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
List otherList = new ArrayList(); getGroupList(putMap, record, OtherInfo.class, ElevatorBaseInfoForWXModel.class, otherInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
getGroupList(null ,record, OtherInfo.class, OtherInfoModel.class, otherInfoService, otherList, false,dictionaryList,equipmentCategories); getGroupList(putMap, record, UseInfo.class, ElevatorBaseInfoForWXModel.class, unseInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
otherJsonObject.put("title", "其他"); getGroupList(putMap, record, ProduceInfo.class, ElevatorBaseInfoForWXModel.class, produceInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
otherJsonObject.put("tabValue", otherList);
jsonArray.add(otherJsonObject); if (exFactoryList.size() > 0) {
map.put("tab", jsonArray); String area = map.get("USE_PLACE").toString();
JSONObject jsonObject = (JSONObject) exFactoryList.get(0);
return map; List<HashMap<String, Object>> groupValue = (List<HashMap<String, Object>>) jsonObject.get("groupValue");
} groupValue.forEach(e -> {
e.put("fieldValue", putMap.get(e.get("fieldKey")));
public Map<String, Object> getEquipmentInfoWX(String record) { if (e.get("fieldKey").equals("area")) {
List<DataDictionary> dictionaryList = getDictionary(); e.put("fieldValue", area);
List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(null); }
Map<String, Object> map = new HashMap(); });
map.put("SEQUENCE_NBR", record); Object ob = exFactoryList.get(0);
map.put("tableName", "idx_biz_view_jg_claim"); exFactoryList.clear();
ResponseModel<Page<Map<String, Object>>> model=idxFeignService.getPage(map); exFactoryList.add(ob);
List<Map<String, Object>> detialMapList = model.getResult().getRecords(); }
if (!ValidationUtil.isEmpty(detialMapList)) {
map = detialMapList.iterator().next(); exFactoryJsonObject.put("title", "基本信息");
} exFactoryJsonObject.put("tabValue", exFactoryList);
map.putAll(getQRCode(record)); jsonArray.add(exFactoryJsonObject);
if(map.get("EQU_LIST_CODE").equals("3000")) { // 最近检验信息
JSONArray jsonArray = new JSONArray(); JSONObject constructionJsonObject = new JSONObject();
// 基本信息 List constructionList = new ArrayList();
JSONObject exFactoryJsonObject = new JSONObject(); getGroupList(null, record, InspectionDetectionInfo.class, InspectionDetectionInfoModelForWX.class, inspectionDetectionInfoService, constructionList, true, dictionaryList, equipmentCategories);
List exFactoryList = new ArrayList(); constructionJsonObject.put("title", "最近检验信息");
HashMap putMap = new HashMap(); constructionJsonObject.put("tabValue", constructionList);
Field[] fields = ElevatorBaseInfoForWXModel.class.getDeclaredFields(); jsonArray.add(constructionJsonObject);
for (Field f :fields
) { // 设备维保信息
putMap.put(f.getName(),""); JSONObject useJsonObject = new JSONObject();
} List useList = new ArrayList();
getGroupList(null, record, MaintenanceInfo.class, MaintenanceInfoModelForWX.class, unseInfoService, useList, false, dictionaryList, equipmentCategories);
getGroupList( putMap ,record, RegistrationInfo.class, ElevatorBaseInfoForWXModel.class, registrationInfoService, exFactoryList, false,dictionaryList,equipmentCategories); useJsonObject.put("title", "设备维保信息");
getGroupList( putMap , record, DesignInfo.class, ElevatorBaseInfoForWXModel.class, designInfoService, exFactoryList, false,dictionaryList,equipmentCategories); useJsonObject.put("tabValue", useList);
getGroupList( putMap ,record, OtherInfo.class, ElevatorBaseInfoForWXModel.class, otherInfoService, exFactoryList, false,dictionaryList,equipmentCategories); jsonArray.add(useJsonObject);
getGroupList( putMap , record, UseInfo.class, ElevatorBaseInfoForWXModel.class, unseInfoService, exFactoryList, false,dictionaryList,equipmentCategories); map.put("tab", jsonArray);
getGroupList( putMap , record, ProduceInfo.class, ElevatorBaseInfoForWXModel.class, produceInfoService, exFactoryList, false,dictionaryList,equipmentCategories); } else if ("气瓶".equals(map.get("EQU_CATEGORY"))) {
// 基本信息
if(exFactoryList.size() > 0) { Field[] fields2 = CylinderEquBaseInfoForWXModel.class.getDeclaredFields();
String area = map.get("USE_PLACE").toString(); for (Field f : fields2) {
JSONObject jsonObject = (JSONObject) exFactoryList.get(0); putMap.put(f.getName(), "");
List<HashMap<String, Object>> groupValue = (List<HashMap<String, Object>>) jsonObject.get("groupValue"); }
groupValue.forEach(e->{
e.put("fieldValue", putMap.get(e.get("fieldKey"))); getGroupList(putMap, record, RegistrationInfo.class, OtherEquBaseInfoForWXModel.class, registrationInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
if(e.get("fieldKey").equals("area")) { getGroupList(putMap, record, DesignInfo.class, OtherEquBaseInfoForWXModel.class, designInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
e.put("fieldValue", area); getGroupList(putMap, record, OtherInfo.class, OtherEquBaseInfoForWXModel.class, otherInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
} getGroupList(putMap, record, UseInfo.class, OtherEquBaseInfoForWXModel.class, unseInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
}); getGroupList(putMap, record, ProduceInfo.class, OtherEquBaseInfoForWXModel.class, produceInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
Object ob = exFactoryList.get(0);
exFactoryList.clear(); if (exFactoryList.size() > 0) {
exFactoryList.add(ob); JSONObject jsonObject = (JSONObject) exFactoryList.get(0);
} List<HashMap<String, Object>> groupValue = (List<HashMap<String, Object>>) jsonObject.get("groupValue");
groupValue.forEach(e -> {
exFactoryJsonObject.put("title", "基本信息"); e.put("fieldValue", putMap.get(e.get("fieldKey")));
exFactoryJsonObject.put("tabValue", exFactoryList); });
jsonArray.add(exFactoryJsonObject); Object ob = exFactoryList.get(0);
exFactoryList.clear();
// 最近检验信息 exFactoryList.add(ob);
JSONObject constructionJsonObject = new JSONObject(); }
List constructionList = new ArrayList();
getGroupList(null ,record, InspectionDetectionInfo.class, InspectionDetectionInfoModelForWX.class, constructionInfoService, constructionList, true,dictionaryList,equipmentCategories); exFactoryJsonObject.put("title", "基本信息");
constructionJsonObject.put("title", "最近检验信息"); exFactoryJsonObject.put("tabValue", exFactoryList);
constructionJsonObject.put("tabValue", constructionList); jsonArray.add(exFactoryJsonObject);
jsonArray.add(constructionJsonObject);
// 最近检验信息
// 设备维保信息 JSONObject constructionJsonObject = new JSONObject();
JSONObject useJsonObject = new JSONObject(); List constructionList = new ArrayList();
List useList = new ArrayList(); getGroupList(null, record, InspectionDetectionInfo.class, InspectionDetectionInfoModelForWX.class, inspectionDetectionInfoService, constructionList, true, dictionaryList, equipmentCategories);
getGroupList(null ,record, MaintenanceInfo.class, MaintenanceInfoModelForWX.class, unseInfoService, useList, false,dictionaryList,equipmentCategories); constructionJsonObject.put("title", "最近检验信息");
useJsonObject.put("title", "设备维保信息"); constructionJsonObject.put("tabValue", constructionList);
useJsonObject.put("tabValue", useList); jsonArray.add(constructionJsonObject);
jsonArray.add(useJsonObject); map.put("tab", jsonArray);
map.put("tab", jsonArray); } else {
} else { // 基本信息
JSONArray jsonArray = new JSONArray(); Field[] fields3 = OtherEquBaseInfoForWXModel.class.getDeclaredFields();
// 基本信息 for (Field f : fields3) {
JSONObject exFactoryJsonObject = new JSONObject(); putMap.put(f.getName(), "");
List exFactoryList = new ArrayList(); }
HashMap putMap = new HashMap();
Field[] fields = OtherEquBaseInfoForWXModel.class.getDeclaredFields(); getGroupList(putMap, record, RegistrationInfo.class, OtherEquBaseInfoForWXModel.class, registrationInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
for (Field f :fields getGroupList(putMap, record, DesignInfo.class, OtherEquBaseInfoForWXModel.class, designInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
) { getGroupList(putMap, record, OtherInfo.class, OtherEquBaseInfoForWXModel.class, otherInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
putMap.put(f.getName(),""); getGroupList(putMap, record, UseInfo.class, OtherEquBaseInfoForWXModel.class, unseInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
} getGroupList(putMap, record, ProduceInfo.class, OtherEquBaseInfoForWXModel.class, produceInfoService, exFactoryList, false, dictionaryList, equipmentCategories);
getGroupList( putMap ,record, RegistrationInfo.class, OtherEquBaseInfoForWXModel.class, registrationInfoService, exFactoryList, false,dictionaryList,equipmentCategories); if (exFactoryList.size() > 0) {
getGroupList( putMap , record, DesignInfo.class, OtherEquBaseInfoForWXModel.class, designInfoService, exFactoryList, false,dictionaryList,equipmentCategories); JSONObject jsonObject = (JSONObject) exFactoryList.get(0);
getGroupList( putMap ,record, OtherInfo.class, OtherEquBaseInfoForWXModel.class, otherInfoService, exFactoryList, false,dictionaryList,equipmentCategories); List<HashMap<String, Object>> groupValue = (List<HashMap<String, Object>>) jsonObject.get("groupValue");
getGroupList( putMap , record, UseInfo.class, OtherEquBaseInfoForWXModel.class, unseInfoService, exFactoryList, false,dictionaryList,equipmentCategories); groupValue.forEach(e -> {
getGroupList( putMap , record, ProduceInfo.class, OtherEquBaseInfoForWXModel.class, produceInfoService, exFactoryList, false,dictionaryList,equipmentCategories); e.put("fieldValue", putMap.get(e.get("fieldKey")));
});
if(exFactoryList.size() > 0) { Object ob = exFactoryList.get(0);
JSONObject jsonObject = (JSONObject) exFactoryList.get(0); exFactoryList.clear();
List<HashMap<String, Object>> groupValue = (List<HashMap<String, Object>>) jsonObject.get("groupValue"); exFactoryList.add(ob);
groupValue.forEach(e->{ }
e.put("fieldValue", putMap.get(e.get("fieldKey")));
}); exFactoryJsonObject.put("title", "基本信息");
Object ob = exFactoryList.get(0); exFactoryJsonObject.put("tabValue", exFactoryList);
exFactoryList.clear(); jsonArray.add(exFactoryJsonObject);
exFactoryList.add(ob);
} // 最近检验信息
JSONObject constructionJsonObject = new JSONObject();
exFactoryJsonObject.put("title", "基本信息"); List constructionList = new ArrayList();
exFactoryJsonObject.put("tabValue", exFactoryList); getGroupList(null, record, InspectionDetectionInfo.class, InspectionDetectionInfoModelForWX.class, inspectionDetectionInfoService, constructionList, true, dictionaryList, equipmentCategories);
jsonArray.add(exFactoryJsonObject); constructionJsonObject.put("title", "最近检验信息");
constructionJsonObject.put("tabValue", constructionList);
// 最近检验信息 jsonArray.add(constructionJsonObject);
JSONObject constructionJsonObject = new JSONObject(); map.put("tab", jsonArray);
List constructionList = new ArrayList(); }
getGroupList(null ,record, InspectionDetectionInfo.class, InspectionDetectionInfoModelForWX.class, constructionInfoService, constructionList, true,dictionaryList,equipmentCategories); return map;
constructionJsonObject.put("title", "最近检验信息"); }
constructionJsonObject.put("tabValue", constructionList);
jsonArray.add(constructionJsonObject); public void getGroupList(HashMap putMap, 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);
} QueryWrapper wrapper = new QueryWrapper();
return map; wrapper.eq("RECORD", record);
} if (isOne) {
wrapper.orderByDesc("REC_DATE");
public void getGroupList( HashMap putMap, 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);
QueryWrapper wrapper = new QueryWrapper(); List entityList = service.list(wrapper);
wrapper.eq("RECORD", record); Iterator iterator = entityList.iterator();
if (isOne) { JSONObject result;
wrapper.orderByDesc("REC_DATE"); if (!isOne) {
} if (!ValidationUtil.isEmpty(entityList)) {
if (entityList.size() > 0) {
List entityList = service.list(wrapper); while (iterator.hasNext()) {
Iterator iterator = entityList.iterator(); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(iterator.next()));
JSONObject result =new JSONObject(); result = getFieldList(putMap, dto, jsonObject, null, dictionaryList, equipmentCategories);
if (!isOne) { list.add(result);
if (!ValidationUtil.isEmpty(entityList)) { }
if (entityList.size()>0) { }
while (iterator.hasNext()) { }
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(iterator.next())); } else {
result = getFieldList(putMap ,dto, jsonObject, null,dictionaryList,equipmentCategories); int count = entityList.size();
list.add(result); JSONObject jsonObject = null;
} if (count > 0) {
jsonObject = JSON.parseObject(JSON.toJSONString(iterator.next()));
} } else {
} jsonObject = new JSONObject();
}
} else { result = getFieldList(putMap, dto, jsonObject, count, dictionaryList, equipmentCategories);
list.add(result);
int count = entityList.size(); }
JSONObject jsonObject = null; }
if (count>0) {
jsonObject= JSON.parseObject(JSON.toJSONString(iterator.next())); public JSONObject getFieldList(HashMap putMap, Class clazz, JSONObject jsonObject, Integer count, List<DataDictionary> dictionaryList, List<EquipmentCategory> equipmentCategories) {
}else { JSONObject result = new JSONObject();
jsonObject=new JSONObject(); JSONObject ApiModel = JSON.parseObject(JSON.toJSONString(clazz.getAnnotation(ApiModel.class)));
} List<Field> declaredFields = Lists.newArrayList(clazz.getSuperclass().getDeclaredFields());
result = getFieldList( putMap ,dto, jsonObject, count,dictionaryList,equipmentCategories); declaredFields.addAll(Arrays.asList(clazz.getDeclaredFields()));
list.add(result);
} List<Map<String, Object>> list = new ArrayList<>();
if (!ValidationUtil.isEmpty(declaredFields)) {
for (Field field : declaredFields) {
} if (field.getAnnotation(ApiModelProperty.class) != null && !ValidationUtil.isEmpty(field.getAnnotation(ApiModelProperty.class).value())) {
Map<String, Object> map = new HashMap<>();
String filedName = field.getAnnotation(ApiModelProperty.class).value();
public JSONObject getFieldList(HashMap putMap, Class clazz, JSONObject jsonObject, Integer count,List<DataDictionary> dictionaryList,List<EquipmentCategory> equipmentCategories) { // key和value可根据需求存
JSONObject result = new JSONObject(); // 这存的key为注解的值,value为类属性名
JSONObject ApiModel = JSON.parseObject(JSON.toJSONString(clazz.getAnnotation(ApiModel.class))); map.put("fieldName", filedName);
String groupName = ApiModel.getString("description"); map.put("fieldKey", field.getName());
Field[] declaredFields = clazz.getDeclaredFields(); if (!ValidationUtil.isEmpty(jsonObject)) {
List<Map<String, Object>> list = new ArrayList<>(); map.put("fieldValue", jsonObject.getString(field.getName()));
if (!ValidationUtil.isEmpty(declaredFields)) { getCon(field.getName(), jsonObject, map, dictionaryList, equipmentCategories);
for (Field field : declaredFields) { } else {
if (field.getAnnotation(ApiModelProperty.class) != null && !ValidationUtil.isEmpty(field.getAnnotation(ApiModelProperty.class).value())) { map.put("fieldValue", "");
Map<String, Object> map = new HashMap<>(); }
String filedName = field.getAnnotation(ApiModelProperty.class).value();
// key和value可根据需求存 if (null != putMap && putMap.containsKey(field.getName())) {
// 这存的key为注解的值,value为类属性名 if (null != map.get("fieldValue")) {
map.put("fieldName", filedName); putMap.put(field.getName(), map.get("fieldValue"));
map.put("fieldKey", field.getName()); }
if (!ValidationUtil.isEmpty(jsonObject)) { }
map.put("fieldValue", jsonObject.getString(field.getName())); list.add(map);
getCon(field.getName(),jsonObject,map,clazz,dictionaryList,equipmentCategories); }
}else { }
map.put("fieldValue", ""); }
} // 整理出现多个附件的情况
Iterator<Map<String, Object>> iterator = list.iterator();
if(null != putMap && putMap.containsKey(field.getName())) { JSONArray array = new JSONArray();
if(null != map.get("fieldValue")) { Boolean bool = true;
putMap.put(field.getName(), map.get("fieldValue")); String name = "";
} while (iterator.hasNext()) {
} Map<String, Object> map = iterator.next();
list.add(map); String fieldName = map.get("fieldName").toString();
} if (fieldName.contains("附件")) {
} if (bool) {
} // 第一个出现的附件名称为表单显示的名称
// 整理出现多个附件的情况 name = fieldName;
Iterator<Map<String, Object>> iterator = list.iterator(); bool = false;
JSONArray array = new JSONArray(); }
Boolean bool = true; if (!ValidationUtil.isEmpty(map.get("fieldValue"))) {
String name = ""; JSONArray jsonArray = JSON.parseArray(String.valueOf(map.get("fieldValue")));
while (iterator.hasNext()) { JSONArray json = new JSONArray();
Map<String, Object> map = iterator.next(); for (Object obj : jsonArray) {
String fieldName = map.get("fieldName").toString(); JSONObject object = JSON.parseObject(JSON.toJSONString(obj));
if (fieldName.contains("附件")) { if (!ValidationUtil.isEmpty(object)) {
if (bool) { object.getString("url");
// 第一个出现的附件名称为表单显示的名称 object.put("url", object.getString("url"));
name = fieldName; json.add(object);
bool = false; }
} }
if (!ValidationUtil.isEmpty(map.get("fieldValue"))) { array.addAll(json);
JSONArray jsonArray = JSON.parseArray(String.valueOf(map.get("fieldValue"))); }
JSONArray json = new JSONArray(); // 删除所有附件
for (Object obj : jsonArray) { iterator.remove();
JSONObject object = JSON.parseObject(JSON.toJSONString(obj)); }
if (!ValidationUtil.isEmpty(object)) { }
object.getString("url"); // 如果有附件 整理为一个附件 添加入list里
object.put("url",object.getString("url")); if (!bool) {
json.add(object); Map<String, Object> map = new HashMap<>();
} map.put("fieldKey", "files");
} map.put("fieldValue", array);
array.addAll(json); map.put("fieldName", name);
} list.add(map);
// 删除所有附件 }
iterator.remove();
} if (!ValidationUtil.isEmpty(count)) {
} result.put("groupCount", count);
// 如果有附件 整理为一个附件 添加入list里 }
if (!bool) {
Map<String, Object> map = new HashMap<>(); result.put("groupName", ApiModel.getString("description"));
map.put("fieldKey", "files"); result.put("groupKey", ApiModel.getString("value"));
map.put("fieldValue", array); result.put("groupValue", list);
map.put("fieldName", name); return result;
list.add(map); }
}
/**
if (!ValidationUtil.isEmpty(count)) { * 获取焊口编号
result.put("groupCount", count); *
} * @return
*/
result.put("groupName", ApiModel.getString("description")); public JSONObject getQRCode(String code) {
result.put("groupKey", ApiModel.getString("value")); String url = "";
result.put("groupValue", list); JSONObject jsonObject = new JSONObject();
return result; byte[] bytes = QRCodeUtil.generateQRCodeImageByteData(code, 50);
} InputStream inputStream = new ByteArrayInputStream(bytes);
try {
/** MultipartFile file = new MockMultipartFile(code + ".jpg", code + ".jpg", ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream);
* 获取焊口编号 FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFileFree(file, "ugp/qrcode");
* if (date != null) {
* @return Map<String, String> map = date.getResult();
*/ Iterator<String> it = map.keySet().iterator();
public JSONObject getQRCode(String code) { String urlString = it.next();
String url = ""; jsonObject.put("fileUrl", urlString);
JSONObject jsonObject = new JSONObject(); jsonObject.put("fileName", code);
byte[] bytes = QRCodeUtil.generateQRCodeImageByteData(code, 50); }
InputStream inputStream = new ByteArrayInputStream(bytes); } catch (IOException e) {
try { e.printStackTrace();
MultipartFile file = new MockMultipartFile(code + ".jpg", code + ".jpg", ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream); }
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFileFree(file, "ugp/qrcode"); return jsonObject;
if (date != null) { }
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator(); public Object getEquipInfoBySuperviseCode(String supervisoryCode) {
String urlString = it.next(); CategoryOtherInfo categoryOtherInfo = categoryOtherInfoMapper.selectOne(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisoryCode));
jsonObject.put("fileUrl", urlString); return ObjectUtils.isEmpty(categoryOtherInfo) ? null : getEquipmentInfo(categoryOtherInfo.getRecord());
jsonObject.put("fileName", code); }
}
} catch (IOException e) { public Map<String, Object> login(MobileLoginParam param) {
e.printStackTrace(); Map<String, Object> result = new LinkedHashMap<>();
} IdPasswordAuthModel idPasswordAuthModel = new IdPasswordAuthModel();
return jsonObject; idPasswordAuthModel.setLoginId(param.getPhoneNo());
} idPasswordAuthModel.setPassword(param.getVerifyCode());
FeignClientResult<Map<String, String>> idpassword = new FeignClientResult<>();
public Object getEquipInfoBySuperviseCode(String supervisoryCode) { RequestContext.setToken("");
CategoryOtherInfo categoryOtherInfo = categoryOtherInfoMapper.selectOne(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisoryCode)); RequestContext.setProduct(product);
return ObjectUtils.isEmpty(categoryOtherInfo) ? null : getEquipmentInfo(categoryOtherInfo.getRecord()); RequestContext.setAppKey(appKey);
} try {
idpassword = Privilege.authClient.idpassword(idPasswordAuthModel);
public Map<String, Object> login(MobileLoginParam param) { } catch (Exception e) {
Map<String, Object> result = new LinkedHashMap<>(); e.printStackTrace();
IdPasswordAuthModel idPasswordAuthModel = new IdPasswordAuthModel(); }
idPasswordAuthModel.setLoginId(param.getPhoneNo()); if (idpassword.getStatus() != successsCode) {
idPasswordAuthModel.setPassword(param.getVerifyCode());
FeignClientResult<Map<String, String>> idpassword = new FeignClientResult<>(); log.error("远程调用Privilege服务失败", idpassword.getDevMessage());
RequestContext.setToken(""); String message = idpassword.getMessage();
RequestContext.setProduct(product); if (StringUtils.isEmpty(message)) {
RequestContext.setAppKey(appKey); message = "账号或密码错误";
try { }
idpassword = Privilege.authClient.idpassword(idPasswordAuthModel); throw new CommonException(600001, message);
} catch (Exception e) { }
e.printStackTrace(); if (ValidationUtil.isEmpty(idpassword) || ValidationUtil.isEmpty(idpassword.getResult()) ||
} ValidationUtil.isEmpty(idpassword.getResult().get("userId"))) {
if (idpassword.getStatus() != successsCode) { log.error("未修改成功");
return new HashMap<String, Object>();
log.error("远程调用Privilege服务失败", idpassword.getDevMessage()); }
String message = idpassword.getMessage();
if (StringUtils.isEmpty(message)) { HashMap<Object, Object> authInfo = new HashMap<>();// 设置authInfo信息
message = "账号或密码错误"; authInfo.put("token", idpassword.getResult().get("token"));
} authInfo.put("personId", idpassword.getResult().get("userId"));
throw new CommonException(600001, message); authInfo.put("appKey", appKey);
} authInfo.put("product", product);
if (ValidationUtil.isEmpty(idpassword) || ValidationUtil.isEmpty(idpassword.getResult()) || result.put("authInfo", authInfo);
ValidationUtil.isEmpty(idpassword.getResult().get("userId"))) { //查询用户信息
log.error("未修改成功"); RequestContext.setToken(idpassword.getResult().get("token"));
return new HashMap<String, Object>(); FeignClientResult<AgencyUserModel> getme = Privilege.agencyUserClient.getme();
} getme.getResult().setPassword("");
getme.getResult().setAppCodes(new ArrayList());
HashMap<Object, Object> authInfo = new HashMap<>();// 设置authInfo信息 result.put("userInfo", getme.getResult());
authInfo.put("token", idpassword.getResult().get("token")); return result;
authInfo.put("personId", idpassword.getResult().get("userId")); }
authInfo.put("appKey", appKey);
authInfo.put("product", product);
result.put("authInfo", authInfo); @SneakyThrows
//查询用户信息 public JSONObject wxUserLogin(JSONObject wx) {
RequestContext.setToken(idpassword.getResult().get("token")); JSONObject obj = getSessionKey(wx);
FeignClientResult<AgencyUserModel> getme = Privilege.agencyUserClient.getme(); String sessionKey = obj.getString("session_key");
getme.getResult().setPassword(""); //被加密的数据
getme.getResult().setAppCodes(new ArrayList()); byte[] dataByte = Base64.getDecoder().decode(wx.getString("encryptedData"));
result.put("userInfo", getme.getResult()); //加密秘钥
return result; byte[] keyByte = Base64.getDecoder().decode(sessionKey);
} //偏移量
byte[] ivByte = Base64.getDecoder().decode(wx.getString("iv"));
JSONObject res = null;
@SneakyThrows // 如果密钥不足16位,那么就补足. 这个if 中的内容很重要
public JSONObject wxUserLogin(JSONObject wx) { int base = 16;
JSONObject obj = getSessionKey(wx); if (keyByte.length % base != 0) {
String sessionKey = obj.getString("session_key"); int groups = keyByte.length / base + (keyByte.length % base != 0 ? 1 : 0);
//被加密的数据 byte[] temp = new byte[groups * base];
byte[] dataByte = Base64.getDecoder().decode(wx.getString("encryptedData")); Arrays.fill(temp, (byte) 0);
//加密秘钥 System.arraycopy(keyByte, 0, temp, 0, keyByte.length);
byte[] keyByte = Base64.getDecoder().decode(sessionKey); keyByte = temp;
//偏移量 }
byte[] ivByte = Base64.getDecoder().decode(wx.getString("iv")); // 初始化
JSONObject res=null; Security.addProvider(new BouncyCastleProvider());
// 如果密钥不足16位,那么就补足. 这个if 中的内容很重要 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding", "BC");
int base = 16; SecretKeySpec spec = new SecretKeySpec(keyByte, "AES");
if (keyByte.length % base != 0) { AlgorithmParameters parameters = AlgorithmParameters.getInstance("AES");
int groups = keyByte.length / base + (keyByte.length % base != 0 ? 1 : 0); parameters.init(new IvParameterSpec(ivByte));
byte[] temp = new byte[groups * base]; cipher.init(Cipher.DECRYPT_MODE, spec, parameters);// 初始化
Arrays.fill(temp, (byte) 0); byte[] resultByte = cipher.doFinal(dataByte);
System.arraycopy(keyByte, 0, temp, 0, keyByte.length); if (null != resultByte && resultByte.length > 0) {
keyByte = temp; String result = new String(resultByte, "UTF-8");
} res = JSONObject.parseObject(result);
// 初始化 return res;
Security.addProvider(new BouncyCastleProvider()); }
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding","BC");
SecretKeySpec spec = new SecretKeySpec(keyByte, "AES"); return res;
AlgorithmParameters parameters = AlgorithmParameters.getInstance("AES");
parameters.init(new IvParameterSpec(ivByte)); }
cipher.init(Cipher.DECRYPT_MODE, spec, parameters);// 初始化
byte[] resultByte = cipher.doFinal(dataByte);
if (null != resultByte && resultByte.length > 0) { private JSONObject getSessionKey(JSONObject wx) {
String result = new String(resultByte, "UTF-8"); StringBuffer buffer = new StringBuffer("https://api.weixin.qq.com/sns/jscode2session?appid=")
res=JSONObject.parseObject(result); .append(WxAppAppId).append("&secret=").append(WxAppSecret).append("&js_code=").append(wx.getString("js_code"))
return res ; .append("&grant_type=").append(WxAppGrantType);
} String responseStr = HttpUtils.doGet(buffer.toString());
JSONObject response = JSONObject.parseObject(responseStr);
return res; return response;
}
}
public Page equipmentCount(String companyCode) {
private JSONObject getSessionKey(JSONObject wx) { Page page = new Page<>();
StringBuffer buffer = new StringBuffer("https://api.weixin.qq.com/sns/jscode2session?appid=") Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
.append(WxAppAppId).append("&secret=").append(WxAppSecret).append("&js_code=").append(wx.getString("js_code")) List<Map<String, Object>> mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode());
.append("&grant_type=").append(WxAppGrantType); List<Map<String, Object>> list = new ArrayList<>();
String responseStr = HttpUtils.doGet(buffer.toString()); List<Map<String, Object>> listMap = equipmentCategoryMapper.getCategoryCount(companyCode);
JSONObject response = JSONObject.parseObject(responseStr); for (Map<String, Object> map : mapList) {
return response; for (Map<String, Object> map1 : listMap) {
} if (map.get("code").equals(map1.get("category"))) {
map.put("waitClaim", map1.get("waitClaim"));
map.put("alreadyClaim", map1.get("alreadyClaim"));
map.put("refuseClaim", map1.get("refuseClaim"));
public Page equipmentCount(String companyCode) { Long sum = Long.valueOf(map1.get("waitClaim").toString()) + Long.valueOf(map1.get("alreadyClaim").toString()) + Long.valueOf(map1.get("refuseClaim").toString());
Page page = new Page<>(); map.put("sum", sum);
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory); }
List<Map<String, Object>> mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode()); }
List<Map<String, Object>> list = new ArrayList<>(); list.add(map);
List<Map<String, Object>> listMap = equipmentCategoryMapper.getCategoryCount(companyCode); }
for (Map<String, Object> map : mapList) { page.setCurrent(1);
for (Map<String, Object> map1 : listMap) { page.setTotal(list.size());
if (map.get("code").equals(map1.get("category"))) { page.setRecords(list);
map.put("waitClaim", map1.get("waitClaim")); return page;
map.put("alreadyClaim", map1.get("alreadyClaim")); }
map.put("refuseClaim", map1.get("refuseClaim"));
Long sum = Long.valueOf(map1.get("waitClaim").toString()) + Long.valueOf(map1.get("alreadyClaim").toString()) + Long.valueOf(map1.get("refuseClaim").toString()); public Page<Map<String, Object>> getTable(Map<String, Object> map) {
map.put("sum", sum); Page<Map<String, Object>> table = null;
} String teqy = (String) map.get("teqy");
} if (ValidationUtil.isEmpty(teqy)) {
list.add(map); table = equipmentCategoryServiceImpl.getTable(map);
} } else {
page.setCurrent(1); map.remove("teqy");
page.setTotal(list.size()); table = idxFeignService.getPage(map).getResult();
page.setRecords(list); }
return page; return table;
} }
public Page<Map<String,Object>> getTable(Map<String, Object> map) {
Page<Map<String, Object>> table=null; public JSONArray getRegionName() {
String teqy = (String)map.get("teqy"); JSONArray jsonArray = new JSONArray();
if (ValidationUtil.isEmpty(teqy) ) { if (redisUtils.hasKey(regionRedis)) {
table = equipmentCategoryServiceImpl.getTable(map); jsonArray = JSONArray.parseArray(redisUtils.get(regionRedis).toString());
}else { } else {
map.remove("teqy"); Collection<RegionModel> regionChild = new ArrayList<>();
table = idxFeignService.getPage(map).getResult(); RegionModel regionModel1 = new RegionModel();
} regionChild.add(regionModel1);
return table; FeignClientResult<Collection<RegionModel>> collectionFeignClientResult = Systemctl.regionClient.queryForTreeParent(610000L);
} Collection<RegionModel> result = collectionFeignClientResult.getResult();
for (RegionModel regionModel : result) {
for (RegionModel child : regionModel.getChildren()) {
public JSONArray getRegionName(){ for (RegionModel childChild : child.getChildren()) {
JSONArray jsonArray = new JSONArray(); jsonArray.add(childChild);
if (redisUtils.hasKey(regionRedis)) { }
jsonArray= JSONArray.parseArray(redisUtils.get(regionRedis).toString()); child.setChildren(regionChild);
}else { jsonArray.add(child);
Collection<RegionModel> regionChild = new ArrayList<>(); }
RegionModel regionModel1 = new RegionModel(); regionModel.setChildren(regionChild);
regionChild.add(regionModel1); jsonArray.add(regionModel);
FeignClientResult<Collection<RegionModel>> collectionFeignClientResult = Systemctl.regionClient.queryForTreeParent(610000L); }
Collection<RegionModel> result = collectionFeignClientResult.getResult();
for (RegionModel regionModel : result) { redisUtils.set(regionRedis, jsonArray);
for (RegionModel child : regionModel.getChildren()) { }
for (RegionModel childChild : child.getChildren()) { return jsonArray;
jsonArray.add(childChild); }
}
child.setChildren(regionChild); //查询字典值(只针对设备一码通详情字典,其他勿用)
jsonArray.add(child); public List<DataDictionary> getDictionary() {
} LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>();
regionModel.setChildren(regionChild); wrapper.ge(DataDictionary::getSequenceNbr, 5951L).le(DataDictionary::getSequenceNbr, 6529L);
jsonArray.add(regionModel); List<DataDictionary> dataDictionaryList = dataDictionaryMapper.selectList(wrapper);
} return dataDictionaryList;
}
redisUtils.set(regionRedis,jsonArray);
} // 处理字典值
return jsonArray; public void getCon(String fileName, JSONObject jsonObject, Map<String, Object> map,
} List<DataDictionary> dictionaryList, List<EquipmentCategory> equipmentCategories) {
if ("province".contains(fileName) || "city".contains(fileName) || "county".contains(fileName)) {
//查询字典值(只针对设备一码通详情字典,其他勿用) JSONArray regionName = getRegionName();
public List<DataDictionary> getDictionary(){ List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class);
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>(); if (!ValidationUtil.isEmpty(list) && !ValidationUtil.isEmpty(jsonObject.getString(fileName))) {
wrapper.ge(DataDictionary::getSequenceNbr ,5951L).le(DataDictionary::getSequenceNbr ,6529L); String cityName =
List<DataDictionary> dataDictionaryList = dataDictionaryMapper.selectList(wrapper); list.stream().filter(i -> i.getRegionCode().equals(Integer.valueOf(jsonObject.getString("city")))).findFirst().orElse(new RegionModel()).getRegionName();
return dataDictionaryList; String countyName =
} list.stream().filter(i -> i.getRegionCode().equals(Integer.valueOf(jsonObject.getString(
public void getCon(String fileName,JSONObject jsonObject,Map<String, Object> map,Class clazz,List<DataDictionary> dictionaryList,List<EquipmentCategory> equipmentCategories) { "county")))).findFirst().orElse(new RegionModel()).getRegionName();
map.put("fieldValue", cityName + "/" + countyName);
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 ("designStandard".indexOf(fileName) != -1) {
if (re.getRegionCode().equals(Integer.valueOf(jsonObject.getString(fileName)))) { JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString(fileName));
map.put("fieldValue", re.getRegionName()); map.put("fieldValue", jsonArray);
} }
}
} getIf("imported", fileName, "BOOLEN", dictionaryList, jsonObject, map);
getIf("changes", fileName, "BGSX", dictionaryList, jsonObject, map);
if ("designStandard".indexOf(fileName) !=-1) { getIf("usePlace", fileName, "ADDRESS", dictionaryList, jsonObject, map);
JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString(fileName)); getIf("equManageDt", fileName, "ZGBM", dictionaryList, jsonObject, map);
map.put("fieldValue", jsonArray); getIf("equState", fileName, "SHZT", dictionaryList, jsonObject, map);
} getIf("denselyPopulatedAreas", fileName, "BOOLEN", dictionaryList, jsonObject, map);
getIf("importantPlaces", fileName, "BOOLEN", dictionaryList, jsonObject, map);
getIf("imported",fileName,"BOOLEN",dictionaryList,jsonObject,map); getIf("registerState", fileName, "ZC", dictionaryList, jsonObject, map);
getIf("changes",fileName,"BGSX",dictionaryList,jsonObject,map); getIf("inspectType", fileName, "JYLX", dictionaryList, jsonObject, map);
getIf("usePlace",fileName,"ADDRESS",dictionaryList,jsonObject,map); getIf("inspectConclusion", fileName, "JYJL", dictionaryList, jsonObject, map);
getIf("equManageDt",fileName,"ZGBM",dictionaryList,jsonObject,map); getIf("constructionType", fileName, "SGLX", dictionaryList, jsonObject, map);
getIf("equState",fileName,"SHZT",dictionaryList,jsonObject,map);
getIf("denselyPopulatedAreas",fileName,"BOOLEN",dictionaryList,jsonObject,map); for (EquipmentCategory equipmentCategory : equipmentCategories) {
getIf("importantPlaces",fileName,"BOOLEN",dictionaryList,jsonObject,map); if ("equDefine".contains(fileName) && !ValidationUtil.isEmpty(equipmentCategory) && !ValidationUtil.isEmpty(equipmentCategory.getCode()) &&
getIf("registerState",fileName,"ZC",dictionaryList,jsonObject,map); !ValidationUtil.isEmpty(fileName) && !ValidationUtil.isEmpty(jsonObject.getString(fileName)) && equipmentCategory.getCode().contains(jsonObject.getString(fileName))) {
getIf("inspectType",fileName,"JYLX",dictionaryList,jsonObject,map); map.put("fieldValue", equipmentCategory.getName());
getIf("inspectConclusion",fileName,"JYJL",dictionaryList,jsonObject,map); }
getIf("constructionType",fileName,"SGLX",dictionaryList,jsonObject,map); if ("equCategory".contains(fileName) && !ValidationUtil.isEmpty(equipmentCategory) && !ValidationUtil.isEmpty(equipmentCategory.getCode()) &&
!ValidationUtil.isEmpty(fileName) && !ValidationUtil.isEmpty(jsonObject.getString(fileName)) && equipmentCategory.getCode().contains(jsonObject.getString(fileName))) {
for (EquipmentCategory equipmentCategory : equipmentCategories) { map.put("fieldValue", equipmentCategory.getName());
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() ); getIf("carrierLine", fileName, "YZS", dictionaryList, jsonObject, map);
} getIf("deviceLevel", fileName, "GLJB", dictionaryList, jsonObject, map);
if ("equCategory".indexOf(fileName) != -1 && !ValidationUtil.isEmpty(equipmentCategory) && !ValidationUtil.isEmpty(equipmentCategory.getCode()) && getIf("fuelType", fileName, "GLZL", dictionaryList, jsonObject, map);
!ValidationUtil.isEmpty(fileName) && !ValidationUtil.isEmpty(jsonObject.getString(fileName)) && equipmentCategory.getCode().indexOf(jsonObject.getString(fileName)) !=-1) { getIf("nameOfPressureParts", fileName, "GLBJMC", dictionaryList, jsonObject, map);
map.put("fieldValue",equipmentCategory.getName() ); getIf("nonDestructiveTestingMethodsForPressureParts", fileName, "GLWSJCFF", dictionaryList, jsonObject, map);
} getIf("qpLossless", fileName, "RQJCFF", dictionaryList, jsonObject, map);
} getIf("glLossless", fileName, "RQJCFF", dictionaryList, jsonObject, map);
getIf("carrierLine",fileName,"YZS",dictionaryList,jsonObject,map); getIf("mainStructureType", fileName, "RQJG", dictionaryList, jsonObject, map);
getIf("deviceLevel",fileName,"GLJB",dictionaryList,jsonObject,map); getIf("checkLossless", fileName, "RQJCFF", dictionaryList, jsonObject, map);
getIf("fuelType",fileName,"GLZL",dictionaryList,jsonObject,map); getIf("pipelineClass", fileName, "GDLB", dictionaryList, jsonObject, map);
getIf("nameOfPressureParts",fileName,"GLBJMC",dictionaryList,jsonObject,map); getIf("deviceLevel", fileName, "GBI", dictionaryList, jsonObject, map);
getIf("nonDestructiveTestingMethodsForPressureParts",fileName,"GLWSJCFF",dictionaryList,jsonObject,map); getIf("workLevel", fileName, "GZJB", dictionaryList, jsonObject, map);
getIf("qpLossless",fileName,"RQJCFF",dictionaryList,jsonObject,map); getIf("mainStructureType", fileName, "JGS", dictionaryList, jsonObject, map);
getIf("glLossless",fileName,"RQJCFF",dictionaryList,jsonObject,map); getIf("luffingMode", fileName, "BFFS", dictionaryList, jsonObject, map);
getIf("mainStructureType",fileName,"RQJG",dictionaryList,jsonObject,map); getIf("towerStandardType", fileName, "JXS", dictionaryList, jsonObject, map);
getIf("checkLossless",fileName,"RQJCFF",dictionaryList,jsonObject,map); getIf("baseType", fileName, "JZXS", dictionaryList, jsonObject, map);
getIf("pipelineClass",fileName,"GDLB",dictionaryList,jsonObject,map); getIf("outriggerType", fileName, "ZT", dictionaryList, jsonObject, map);
getIf("deviceLevel",fileName,"GBI",dictionaryList,jsonObject,map); getIf("mainBeamType", fileName, "ZLXS", dictionaryList, jsonObject, map);
getIf("workLevel",fileName,"GZJB",dictionaryList,jsonObject,map); getIf("boomType", fileName, "BJXS", dictionaryList, jsonObject, map);
getIf("mainStructureType",fileName,"JGS",dictionaryList,jsonObject,map); getIf("boomStructureType", fileName, "BJJGXS", dictionaryList, jsonObject, map);
getIf("luffingMode",fileName,"BFFS",dictionaryList,jsonObject,map); getIf("gantryStructureType", fileName, "MJJG", dictionaryList, jsonObject, map);
getIf("towerStandardType",fileName,"JXS",dictionaryList,jsonObject,map); getIf("use", fileName, "YT", dictionaryList, jsonObject, map);
getIf("baseType",fileName,"JZXS",dictionaryList,jsonObject,map); getIf("controlMode", fileName, "CZFS", dictionaryList, jsonObject, map);
getIf("outriggerType",fileName,"ZT",dictionaryList,jsonObject,map); getIf("hangingCagesNumber", fileName, "DLSL", dictionaryList, jsonObject, map);
getIf("mainBeamType",fileName,"ZLXS",dictionaryList,jsonObject,map); getIf("driveMechanismType", fileName, "QDJG", dictionaryList, jsonObject, map);
getIf("boomType",fileName,"BJXS",dictionaryList,jsonObject,map); getIf("guideRailFrame", fileName, "DS", dictionaryList, jsonObject, map);
getIf("boomStructureType",fileName,"BJJGXS",dictionaryList,jsonObject,map); getIf("liftingDriveMode", fileName, "QD", dictionaryList, jsonObject, map);
getIf("gantryStructureType",fileName,"MJJG",dictionaryList,jsonObject,map); getIf("operationMode", fileName, "JXCZ", dictionaryList, jsonObject, map);
getIf("use",fileName,"YT",dictionaryList,jsonObject,map); getIf("liftingMode", fileName, "QSFS", dictionaryList, jsonObject, map);
getIf("controlMode",fileName,"CZFS",dictionaryList,jsonObject,map); getIf("explosionProofGrade", fileName, "FBDJ", dictionaryList, jsonObject, map);
getIf("hangingCagesNumber",fileName,"DLSL",dictionaryList,jsonObject,map); getIf("hoistWorkingLevel", fileName, "GZJB", dictionaryList, jsonObject, map);
getIf("driveMechanismType",fileName,"QDJG",dictionaryList,jsonObject,map); getIf("bigcarTraveWorkingLevel", fileName, "GZJB", dictionaryList, jsonObject, map);
getIf("guideRailFrame",fileName,"DS",dictionaryList,jsonObject,map); getIf("smallcarTraveWorkingLevel", fileName, "GZJB", dictionaryList, jsonObject, map);
getIf("liftingDriveMode",fileName,"QD",dictionaryList,jsonObject,map); getIf("hoistWorkingLevel", fileName, "GZJB", dictionaryList, jsonObject, map);
getIf("operationMode",fileName,"JXCZ",dictionaryList,jsonObject,map); getIf("smallcarSideswayWorkingLevel", fileName, "GZJB", dictionaryList, jsonObject, map);
getIf("liftingMode",fileName,"QSFS",dictionaryList,jsonObject,map); getIf("partName", fileName, "ZYLBJ", dictionaryList, jsonObject, map);
getIf("explosionProofGrade",fileName,"FBDJ",dictionaryList,jsonObject,map); getIf("workType", fileName, "GZLX", dictionaryList, jsonObject, map);
getIf("hoistWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map); getIf("controlMode", fileName, "KZFS", dictionaryList, jsonObject, map);
getIf("bigcarTraveWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map); getIf("jackingType", fileName, "DSXS", dictionaryList, jsonObject, map);
getIf("smallcarTraveWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map); getIf("explosionproofType", fileName, "FBXS", dictionaryList, jsonObject, map);
getIf("hoistWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map); getIf("explosionproofGrade", fileName, "FBDJ", dictionaryList, jsonObject, map);
getIf("smallcarSideswayWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map); getIf("xgxlMediaType", fileName, "XGJZZL", dictionaryList, jsonObject, map);
getIf("partName",fileName,"ZYLBJ",dictionaryList,jsonObject,map); getIf("designation", fileName, "KYSDBJMC", dictionaryList, jsonObject, map);
getIf("workType",fileName,"GZLX",dictionaryList,jsonObject,map); getIf("designation", fileName, "CCFJDCLLBJMC", dictionaryList, jsonObject, map);
getIf("controlMode",fileName,"KZFS",dictionaryList,jsonObject,map); getIf("isMonitor", fileName, "HAVE", dictionaryList, jsonObject, map);
getIf("jackingType",fileName,"DSXS",dictionaryList,jsonObject,map); if ("equList".indexOf(fileName) != -1) {
getIf("explosionproofType",fileName,"FBXS",dictionaryList,jsonObject,map); String equList = EquipmentClassifityEnum.getName.get(jsonObject.getString(fileName));
getIf("explosionproofGrade",fileName,"FBDJ",dictionaryList,jsonObject,map); map.put("fieldValue", equList);
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); public void getIf(String name, String fileName, String type, List<DataDictionary> dictionaryList, JSONObject jsonObject, Map<String, Object> map) {
if ("equList".indexOf(fileName) !=-1) { if (name.indexOf(fileName) != -1) {
String equList = EquipmentClassifityEnum.getName.get(jsonObject.getString(fileName)); List<DataDictionary> list = dictionaryList.stream().filter(t -> t.getType().equals(type) && t.getCode().equals(jsonObject.getString(fileName))).collect(Collectors.toList());
map.put("fieldValue", equList); if (list.size() > 0) {
} map.put("fieldValue", list.get(0).getName());
} }
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