| | |
| | | package com.panzhihua.serviceapi.biz.impl; |
| | | |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import java.net.URISyntaxException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | |
| | | import com.panzhihua.serviceapi.biz.LcApiService; |
| | | import com.panzhihua.serviceapi.model.dto.GridMemberPageListDTO; |
| | | import com.panzhihua.serviceapi.model.dto.LcGridData; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.net.URISyntaxException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | @Slf4j |
| | | @SpringBootTest(classes = ServiceApiApplication.class) |
| | |
| | | log.info(result); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | void automationUploadEventAndFile() { |
| | | lcApiService.automationUploadEventAndFile(); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | void submitEventRegister() { |
| | |
| | | String lcGridUserId = gridService.getLcUserIdByLocalUserId(eventInfoVo.getGridMemberId().toString()); |
| | | eventInfo.setGridId(lcGrid); |
| | | R grid = gridService.eventGridDataDetails(eventInfoVo.getGridId()); |
| | | EventGridDataDetailsVO gridData = (EventGridDataDetailsVO) grid.getData(); |
| | | EventGridDataDetailsVO gridData = (EventGridDataDetailsVO)grid.getData(); |
| | | eventInfo.setGridName(gridData.getGridName()); |
| | | eventInfo.setCaseTypeCode(LocalEventToLangChaoEventTypeEnum.getCodeByName(eventInfoVo.getEventType())); |
| | | String caseTypeName = LocalEventToLangChaoEventTypeEnum.getEventNameByCode(eventInfoVo.getEventType()); |
| | |
| | | eventInfo.setHandleType("REPORT"); |
| | | eventInfo.setHandleDescription(eventInfoVo.getProcessDesc()); |
| | | eventInfo.setDataId(eventInfoVo.getId().toString()); |
| | | //获取系统网格员映射的浪潮网格员对于的用户ID |
| | | // 获取系统网格员映射的浪潮网格员对于的用户ID |
| | | eventInfo.setUserId(lcGridUserId); |
| | | eventInfo.setHandleTime(String.valueOf(eventInfoVo.getHappenTime().getTime())); |
| | | eventInfo.setCaseName(gridData.getGridName().concat(caseTypeName).concat(eventInfoVo.getEventTitle())); |
| | |
| | | log.info("结束上传附件图片信息"); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | void getGridListByAreaId() { |
| | | //jhRxqEQp 代表西区 |
| | | // jhRxqEQp 代表西区 |
| | | List<LcGridData> list = lcApiService.getGridTreeByAreaId("jhRxqEQp"); |
| | | String pretty = JSONArray.toJSONString(list, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, |
| | | SerializerFeature.WriteDateUseDateFormat); |
| | | String pretty = JSONArray.toJSONString(list, SerializerFeature.PrettyFormat, |
| | | SerializerFeature.WriteMapNullValue, SerializerFeature.WriteDateUseDateFormat); |
| | | log.info(pretty); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | void getGridDataListByAreaId() { |
| | | //jhRxqEQp 代表西区 |
| | | // jhRxqEQp 代表西区 |
| | | List<LcGridData> list = lcApiService.getGridDataListByAreaId("2Fxq97CC"); |
| | | String pretty = JSONArray.toJSONString(list, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, |
| | | SerializerFeature.WriteDateUseDateFormat); |
| | | String pretty = JSONArray.toJSONString(list, SerializerFeature.PrettyFormat, |
| | | SerializerFeature.WriteMapNullValue, SerializerFeature.WriteDateUseDateFormat); |
| | | log.info(pretty); |
| | | } |
| | | |
| | | @Test |
| | | void requestLcFlowPersonVisitRecord() { |
| | | } |
| | | void requestLcFlowPersonVisitRecord() {} |
| | | |
| | | @Test |
| | | void automationUploadVisitRecord() { |
| | |
| | | |
| | | @Test |
| | | void getGridMemberListByAreaIdOrName() { |
| | | List<GridMemberPageListDTO> data = lcApiService.getGridMemberListByAreaIdOrName("jhRxqEQp", "",1L,20L); |
| | | List<GridMemberPageListDTO> data = lcApiService.getGridMemberListByAreaIdOrName("jhRxqEQp", "", 1L, 20L); |
| | | // log.info(data); |
| | | } |
| | | |
| | | @Test |
| | | void downloadDiction() { |
| | | //获取字典全部大类 |
| | | // 获取字典全部大类 |
| | | HttpRequest request = HttpUtil.createPost("http://171.217.92.33:53301/dict/getTypeTree"); |
| | | request.cookie("SESSION=ZTQ1ZGRmZjktNWU1MC00ZjEyLWJhOGItNDdjZjlmODc1MjQy; UISESSIONMEMBER=C6FE0698B29832B18CBAEB71CCD3A2BA"); |
| | | request.cookie( |
| | | "SESSION=ZTQ1ZGRmZjktNWU1MC00ZjEyLWJhOGItNDdjZjlmODc1MjQy; UISESSIONMEMBER=C6FE0698B29832B18CBAEB71CCD3A2BA"); |
| | | HttpResponse result = request.execute(); |
| | | List<DictionData> remoteData = JSONArray.parseArray(result.body(), DictionData.class); |
| | | remoteData.forEach(dictionData -> { |
| | |
| | | dictionaryVO.setLevelIndex(1); |
| | | dictionaryVO.setParentId(0L); |
| | | communityService.insertDiction(dictionaryVO); |
| | | //获取二级字典项 |
| | | // 获取二级字典项 |
| | | dictionData.getChildren().forEach(children -> { |
| | | DictionaryVO dictionaryChiVO = new DictionaryVO(); |
| | | long erparentzId = Snowflake.getId(); |
| | |
| | | dictionaryChiVO.setLevelIndex(2); |
| | | dictionaryChiVO.setParentId(dictionaryVO.getId()); |
| | | communityService.insertDiction(dictionaryChiVO); |
| | | //获取字典全部值 |
| | | HttpRequest requestDictionValue = HttpUtil.createPost("http://171.217.92.33:53301/dict/getDictByTypeCodeAndParentId?typeCode=" + children.getId() + "&parentId=0"); |
| | | requestDictionValue.cookie("SESSION=ZTQ1ZGRmZjktNWU1MC00ZjEyLWJhOGItNDdjZjlmODc1MjQy; UISESSIONMEMBER=C6FE0698B29832B18CBAEB71CCD3A2BA"); |
| | | // 获取字典全部值 |
| | | HttpRequest requestDictionValue = |
| | | HttpUtil.createPost("http://171.217.92.33:53301/dict/getDictByTypeCodeAndParentId?typeCode=" |
| | | + children.getId() + "&parentId=0"); |
| | | requestDictionValue.cookie( |
| | | "SESSION=ZTQ1ZGRmZjktNWU1MC00ZjEyLWJhOGItNDdjZjlmODc1MjQy; UISESSIONMEMBER=C6FE0698B29832B18CBAEB71CCD3A2BA"); |
| | | HttpResponse childResult = requestDictionValue.execute(); |
| | | LcReturnObject remoteDataChild = JSONObject.parseObject(childResult.body(), LcReturnObject.class); |
| | | List<DictionValueData> dictionValueData = JSONArray.parseArray(remoteDataChild.getData(), DictionValueData.class); |
| | | List<DictionValueData> dictionValueData = |
| | | JSONArray.parseArray(remoteDataChild.getData(), DictionValueData.class); |
| | | dictionValueData.forEach(dictionValueData1 -> { |
| | | BcDictionaryVO dictionaryItemVO = new BcDictionaryVO(); |
| | | dictionaryItemVO.setDictName(dictionValueData1.getDictName()); |
| | |
| | | dictionaryItemVO.setDictId(erparentzId); |
| | | communityService.insertDictionItem(dictionaryItemVO); |
| | | }); |
| | | // String pretty = JSONArray.toJSONString(dictionValueData, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, |
| | | // SerializerFeature.WriteDateUseDateFormat); |
| | | // log.info(pretty); |
| | | // String pretty = JSONArray.toJSONString(dictionValueData, SerializerFeature.PrettyFormat, |
| | | // SerializerFeature.WriteMapNullValue, |
| | | // SerializerFeature.WriteDateUseDateFormat); |
| | | // log.info(pretty); |
| | | }); |
| | | }); |
| | | } |