|
|
|
@ -65,7 +65,9 @@ import com.elink.esua.epdc.gird.shibei.dto.SearchCaseProcessByTaskIdDto; |
|
|
|
import com.elink.esua.epdc.gird.shibei.dto.SearchCaseProcessByTaskIdItemDto; |
|
|
|
import com.elink.esua.epdc.gird.shibei.dto.form.ImageFile; |
|
|
|
import com.elink.esua.epdc.gird.shibei.dto.form.ReportFile; |
|
|
|
import com.elink.esua.epdc.gird.shibei.dto.form.SendEventFormDto; |
|
|
|
import com.elink.esua.epdc.gird.shibei.dto.form.SendInputInfoFormDto; |
|
|
|
import com.elink.esua.epdc.gird.shibei.dto.result.SendEventResultDto; |
|
|
|
import com.elink.esua.epdc.gird.shibei.util.XstreamUtil; |
|
|
|
import com.elink.esua.epdc.modules.async.IssueOverseeResultsTask; |
|
|
|
import com.elink.esua.epdc.modules.async.NewsTask; |
|
|
|
@ -733,20 +735,20 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
} |
|
|
|
handleProcessEntity.setState(dto.getHandleCategory()); |
|
|
|
informationFormDTO.setTitle(EventsNoticeConstant.NOTICE_REPORT); |
|
|
|
GridDto gridDto = null; |
|
|
|
SendEventResultDto sendResult = null; |
|
|
|
try { |
|
|
|
gridDto = this.reportCase(dto); |
|
|
|
sendResult = this.reportCaseNew(dto); |
|
|
|
} catch (Exception e) { |
|
|
|
return new Result().error("上报网格化平台接口失败" + e.getMessage()); |
|
|
|
} |
|
|
|
if (null == gridDto || !("0").equals(gridDto.getReturnCode())) { |
|
|
|
if (null == sendResult || !("0").equals(sendResult.getCode())) { |
|
|
|
// 接口没有返回信息,也没有异常信息
|
|
|
|
return new Result().error("上报网格化平台接口失败" + gridDto.getReturnDescription()); |
|
|
|
return new Result().error("上报网格化平台接口失败" + sendResult.getMessage()); |
|
|
|
} |
|
|
|
// 记录处理记录
|
|
|
|
itemHandleProcessService.insert(handleProcessEntity); |
|
|
|
// 记录平台上报信息
|
|
|
|
this.saveItemGridPlatformInfo(gridDto, handleProcessEntity); |
|
|
|
this.saveItemGridPlatformInfo(sendResult, handleProcessEntity); |
|
|
|
} else { |
|
|
|
handleProcessEntity.setState(dto.getHandleCategory()); |
|
|
|
// 更新项目状态
|
|
|
|
@ -1086,6 +1088,30 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
return gridDto; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @describe: 新版时间上报 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/12/16 10:45 |
|
|
|
* @params [dto] |
|
|
|
* @return com.elink.esua.epdc.gird.shibei.dto.GridDto |
|
|
|
*/ |
|
|
|
private SendEventResultDto reportCaseNew(ItemHandleSubmitFormDTO dto) throws Exception { |
|
|
|
ItemEntity entity = baseDao.selectById(dto.getId()); |
|
|
|
// 组装上报信息
|
|
|
|
SendEventFormDto sendEventFormDto = packageSendEventEntity(entity); |
|
|
|
// 接口请求返回实体,getCode 1失败 0成功(非空)
|
|
|
|
SendEventResultDto sendResult = shiBeiCityGridApi.sendEvent(sendEventFormDto); |
|
|
|
// 保存接口调用日志
|
|
|
|
String successFlag = YesOrNoEnum.NO.value(); |
|
|
|
if (NumConstant.ZERO_STR.equals(sendResult.getCode())) { |
|
|
|
successFlag = YesOrNoEnum.YES.value(); |
|
|
|
} |
|
|
|
this.saveInterfaceLog(dto.getId(), InterfaceLogBusinessTypeEnum.REPORT_ITEM.getValue(), |
|
|
|
ApiConstants.newSendInputInfo, successFlag, XstreamUtil.objectToXml(sendEventFormDto), |
|
|
|
XstreamUtil.objectToXml(sendResult)); |
|
|
|
return sendResult; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 保存接口调用日志 |
|
|
|
* |
|
|
|
@ -1169,6 +1195,90 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
return formDto; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @describe: 组装时间上报参数 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/12/16 10:51 |
|
|
|
* @params [itemEntity] |
|
|
|
* @return com.elink.esua.epdc.gird.shibei.dto.form.SendInputInfoFormDto |
|
|
|
*/ |
|
|
|
private SendEventFormDto packageSendEventEntity(ItemEntity itemEntity) throws Exception { |
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
SendEventFormDto sendDto = new SendEventFormDto(); |
|
|
|
SendInputInfoFormDto formDto = new SendInputInfoFormDto(); |
|
|
|
//推送类别(事件上报)
|
|
|
|
sendDto.setSENDTYPE(CommonConstants.SEND_TYPE); |
|
|
|
//上报至区中心平台
|
|
|
|
sendDto.setSENDACTDEFID(CommonConstants.PARTY_SEND_TO); |
|
|
|
//推送端记录唯一标识
|
|
|
|
sendDto.setUID(UUID.randomUUID().toString().trim().replaceAll("-", "")); |
|
|
|
//事件领域
|
|
|
|
Integer lingYu = Integer.valueOf(itemEntity.getFirstCategoryCode()); |
|
|
|
if(lingYu < 10){ |
|
|
|
sendDto.setSJLYU("0"+itemEntity.getFirstCategoryCode()); |
|
|
|
}else{ |
|
|
|
sendDto.setSJLYU(itemEntity.getFirstCategoryCode()); |
|
|
|
} |
|
|
|
//事件大类
|
|
|
|
String secondCate = baseDao.selectSecondCateByItemId(itemEntity.getId()); |
|
|
|
if(StringUtils.isNotBlank(secondCate)){ |
|
|
|
if(secondCate.length()==3){ |
|
|
|
sendDto.setSJDL("0"+secondCate); |
|
|
|
}else{ |
|
|
|
sendDto.setSJDL(secondCate); |
|
|
|
} |
|
|
|
} |
|
|
|
//事件小类
|
|
|
|
sendDto.setSJXL(""); |
|
|
|
//事件细类
|
|
|
|
sendDto.setSJXIL(""); |
|
|
|
//事件来源 04代表 党群e家上报 06代表在市北App上报
|
|
|
|
sendDto.setSJLY(CommonConstants.PARTY_EVENT_SOURCE); |
|
|
|
//所属区市:只有市北区
|
|
|
|
sendDto.setSSQS(CommonConstants.CITY_INFO_CODE); |
|
|
|
//查询网格所对应的社区编码、街道编码
|
|
|
|
Result<DeptInfoCodeDTO> deptResult = adminFeignClient.getDeptInfoCode(itemEntity.getGridId()); |
|
|
|
DeptInfoCodeDTO deptInfo = deptResult.getData(); |
|
|
|
if(deptInfo == null){ |
|
|
|
throw new RenException("根据网格ID获取对应的社区编码、街道编码失败" + deptResult.getMsg()); |
|
|
|
} |
|
|
|
//所属街道
|
|
|
|
sendDto.setSSJD(deptInfo.getStreetInfoCode()); |
|
|
|
//所属社区
|
|
|
|
sendDto.setSSSQ("");//deptInfo.getCommunityInfoCode()
|
|
|
|
//事件地址
|
|
|
|
sendDto.setSJDZ(itemEntity.getIssueAddress()); |
|
|
|
//事件描述
|
|
|
|
sendDto.setSJMS("测试1217【联系电话:17806265786】");//itemEntity.getItemContent()
|
|
|
|
double[] gps = GPSUtils.gcj02_To_Gps84(itemEntity.getIssueLatitude(), itemEntity.getIssueLongitude()); |
|
|
|
//X坐标(经纬度)
|
|
|
|
sendDto.setXZB(new BigDecimal(gps[1]).setScale(15, BigDecimal.ROUND_HALF_UP)); |
|
|
|
//Y坐标(经纬度)
|
|
|
|
sendDto.setYZB(new BigDecimal(gps[0]).setScale(15, BigDecimal.ROUND_HALF_UP)); |
|
|
|
//图片
|
|
|
|
sendDto.setIMAGES(getImageFileNew(itemEntity.getEventId())); |
|
|
|
return sendDto; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @describe: 重新组装图片 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/12/16 15:56 |
|
|
|
* @params [] |
|
|
|
* @return java.util.List<java.lang.String> |
|
|
|
*/ |
|
|
|
private List<String> getImageFileNew(String eventId){ |
|
|
|
//查询图片列表
|
|
|
|
QueryWrapper<ImgEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(eventId), "REFERENCE_ID", eventId); |
|
|
|
List<ImgEntity> imageList = imgDao.selectList(wrapper); |
|
|
|
if (null != imageList && !imageList.isEmpty()) { |
|
|
|
List<String> imgUrlList = this.getUploadDTOList(imageList); |
|
|
|
return imgUrlList; |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
// 组装事件图片
|
|
|
|
private ImageFile getImageFile(String eventId) { |
|
|
|
ImageFile imageFile = new ImageFile(); |
|
|
|
@ -1227,18 +1337,18 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param gridDto |
|
|
|
* @param |
|
|
|
* @param handleProcessEntity |
|
|
|
* @return void |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description |
|
|
|
* @Date 2019/12/25 15:29 |
|
|
|
**/ |
|
|
|
private void saveItemGridPlatformInfo(GridDto gridDto, ItemHandleProcessEntity handleProcessEntity) { |
|
|
|
private void saveItemGridPlatformInfo(SendEventResultDto sendResult, ItemHandleProcessEntity handleProcessEntity) { |
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
ItemGridPlatformEntity itemGridPlatformEntity = new ItemGridPlatformEntity(); |
|
|
|
itemGridPlatformEntity.setReferenceId(handleProcessEntity.getItemId()); |
|
|
|
itemGridPlatformEntity.setTaskid(gridDto.getTaskId()); |
|
|
|
itemGridPlatformEntity.setTaskid(sendResult.getP_recId()); |
|
|
|
itemGridPlatformEntity.setReportPersonDeptId(handleProcessEntity.getHandlerDeptId()); |
|
|
|
itemGridPlatformEntity.setStatus(ItemGridPlatformHandleStatusEnum.HANDLE_SB.getValue()); |
|
|
|
itemGridPlatformService.insert(itemGridPlatformEntity); |
|
|
|
|