|
|
|
@ -23,11 +23,13 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.StrConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.enums.*; |
|
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
@ -42,6 +44,7 @@ import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResult |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.*; |
|
|
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.elink.esua.epdc.constant.*; |
|
|
|
import com.elink.esua.epdc.constants.MenuCodeConstant; |
|
|
|
import com.elink.esua.epdc.dto.*; |
|
|
|
@ -76,7 +79,9 @@ import com.elink.esua.epdc.modules.category.dao.CategoryDao; |
|
|
|
import com.elink.esua.epdc.modules.category.entity.CategoryEntity; |
|
|
|
import com.elink.esua.epdc.modules.category.service.CategoryService; |
|
|
|
import com.elink.esua.epdc.modules.events.dao.ImgDao; |
|
|
|
import com.elink.esua.epdc.modules.events.dao.XxxdEventDao; |
|
|
|
import com.elink.esua.epdc.modules.events.entity.ImgEntity; |
|
|
|
import com.elink.esua.epdc.modules.events.entity.XxxdEventEntity; |
|
|
|
import com.elink.esua.epdc.modules.events.service.EpdcEventsService; |
|
|
|
import com.elink.esua.epdc.modules.events.service.ImgService; |
|
|
|
import com.elink.esua.epdc.modules.feign.AdminFeignClient; |
|
|
|
@ -106,6 +111,7 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.joda.time.DateTime; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
@ -231,6 +237,8 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
// private ItemProcessModifyProducer itemProcessModifyProducer;
|
|
|
|
@Resource |
|
|
|
private ItemDeptDao itemDeptDao; |
|
|
|
@Autowired |
|
|
|
private XxxdEventDao xxxdEventDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<ItemDTO> page(Map<String, Object> params) { |
|
|
|
@ -3441,6 +3449,102 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
return new Result().ok(entity.getSerialNum()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新新向党的事件推送过来,调用此方法。 |
|
|
|
* 此方法与上面的submitMsFzItemResi逻辑一致,只是返参返回epdc_item.id |
|
|
|
* @param formDto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public String submitMsFzItemResiForXxxd(SubmitItemFormDTO formDto) { |
|
|
|
ValidatorUtils.validateEntity(formDto); |
|
|
|
imageCheck(formDto.getImages()); |
|
|
|
ItemEntity entity = ConvertUtils.sourceToTarget(formDto, ItemEntity.class); |
|
|
|
if (null == formDto.getDistributeTime()) { |
|
|
|
entity.setDistributeTime(new Date()); |
|
|
|
} |
|
|
|
entity.setItemState(0);//处理中
|
|
|
|
entity.setLastHandleTime(new Date()); |
|
|
|
entity.setCategoryCode("13"); |
|
|
|
entity.setCategoryFullName("其他"); |
|
|
|
entity.setFirstCategoryCode("13"); |
|
|
|
entity.setItemCode("PT" + System.currentTimeMillis());//项目编号
|
|
|
|
entity.setIsPeople("1");//诉求上报
|
|
|
|
entity.setAppealSource(formDto.getAppealSource()); |
|
|
|
String code = ""; |
|
|
|
if (NumConstant.ZERO_STR.equals(formDto.getPeopleFlag())) { |
|
|
|
//民生诉求所属网格对应的所属社区的市中心编码
|
|
|
|
Result<CompleteDeptDTO> result = adminFeignClient.getCompleteDept(entity.getGridId()); |
|
|
|
if (result.success()) { |
|
|
|
code = result.getData().getCommunityDisCenterZoningCode(); |
|
|
|
} |
|
|
|
entity.setSerialNum(getSerialNum("MS" + code)); |
|
|
|
} else if (NumConstant.ONE_STR.equals(formDto.getPeopleFlag())) { |
|
|
|
//执法诉求所属街道的市中心编码
|
|
|
|
Result<SysDeptDTO> dtoResult = adminFeignClient.getSysDeptInfo(entity.getGridId()); |
|
|
|
if (dtoResult.success()) { |
|
|
|
code = dtoResult.getData().getDisCenterZoningCode(); |
|
|
|
// 因为是街道账号,所以上级一定是市北区委
|
|
|
|
Long pids = dtoResult.getData().getPid(); |
|
|
|
String pnames = dtoResult.getData().getParentName(); |
|
|
|
entity.setParentDeptIds(pids + ""); |
|
|
|
entity.setParentDeptNames(pnames); |
|
|
|
entity.setAllDeptIds(pids + "," + entity.getGridId()); |
|
|
|
entity.setAllDeptNames(pnames + "-" + entity.getGrid()); |
|
|
|
} |
|
|
|
|
|
|
|
entity.setSerialNum(getSerialNum("FZ" + code)); |
|
|
|
} |
|
|
|
baseDao.insert(entity); |
|
|
|
//插入项目部门关联表
|
|
|
|
itemDeptService.savePeopleSubmitInfo(entity); |
|
|
|
// 保存图片
|
|
|
|
imgService.saveImages(formDto.getImages(), entity.getId(), ImageConstant.TYPE_IMAGE_BIZ_EVENTS); |
|
|
|
// 插入项目处理流程表
|
|
|
|
ItemHandleProcessEntity itemHandleProcessEntity = new ItemHandleProcessEntity(); |
|
|
|
itemHandleProcessEntity.setItemId(entity.getId()); |
|
|
|
itemHandleProcessEntity.setState(ItemHandleCategoryEnum.HANDLE_I_HANDLE_GRID_TOP.getValue()); |
|
|
|
itemHandleProcessEntity.setHandleAdvice("诉求已查收,正在办理。"); |
|
|
|
itemHandleProcessEntity.setOutHandleAdvice("诉求已查收,正在办理。"); |
|
|
|
itemHandleProcessEntity.setHandlerDeptId(entity.getGridId()); |
|
|
|
itemHandleProcessEntity.setHandlerDept(entity.getGrid()); |
|
|
|
itemHandleProcessService.insert(itemHandleProcessEntity); |
|
|
|
//发送事件至区中心
|
|
|
|
if ("1".equals(formDto.getPeopleFlag())) { |
|
|
|
//保存至企业表
|
|
|
|
itemEnterpriseService.savaZfInfo(entity, formDto); |
|
|
|
ItemHandleSubmitFormDTO dto = new ItemHandleSubmitFormDTO(); |
|
|
|
dto.setId(entity.getId()); |
|
|
|
dto.setOutHandleAdvice(itemHandleProcessEntity.getOutHandleAdvice()); |
|
|
|
dto.setHandleCategory(ItemHandleCategoryEnum.HANDLE_CLOSING_CASE_APPLY.getValue()); |
|
|
|
sendItemToDsf(dto, itemHandleProcessEntity); |
|
|
|
} |
|
|
|
//发送到市平台
|
|
|
|
/*try { |
|
|
|
if (NumConstant.ZERO_STR.equals(formDto.getPeopleFlag())) { |
|
|
|
//民生
|
|
|
|
sendCaseLivelihood(entity); |
|
|
|
} else if (NumConstant.ONE_STR.equals(formDto.getPeopleFlag())) { |
|
|
|
//发展
|
|
|
|
sendCaseDevelop(entity); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
StringBuffer str = new StringBuffer(); |
|
|
|
switch (formDto.getPeopleFlag()) { |
|
|
|
case NumConstant.ZERO_STR: |
|
|
|
str.append("民生"); |
|
|
|
break; |
|
|
|
case NumConstant.ONE_STR: |
|
|
|
str.append("发展"); |
|
|
|
break; |
|
|
|
} |
|
|
|
str.append("诉求上报,发送事件数据到市中心错误,诉求项目Id->").append(entity.getId()); |
|
|
|
log.error(str.toString()); |
|
|
|
e.printStackTrace(); |
|
|
|
}*/ |
|
|
|
return entity.getId(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return void |
|
|
|
* @describe: 民生诉求 组装数据到市平台 |
|
|
|
@ -5430,4 +5534,72 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 新新向党随手拍事件,保存到民生诉求epdc_item表 |
|
|
|
* |
|
|
|
* @param submitItemFormDTO :新新向党的随手拍事件 |
|
|
|
*/ |
|
|
|
public void submitXxxdEventToItem(String xxxdEventEntityId,String longitude,String latitude,SubmitItemFormDTO submitItemFormDTO) { |
|
|
|
// 0已接收;1已转北上速办事件;2已完结
|
|
|
|
String internalStatus = ""; |
|
|
|
// 北上速办事件id
|
|
|
|
String bssbEventId = ""; |
|
|
|
// 内部备注
|
|
|
|
String internalRemark = ""; |
|
|
|
// 网格id
|
|
|
|
String gridId = ""; |
|
|
|
// 网格名称
|
|
|
|
String gridName = ""; |
|
|
|
// 社区id
|
|
|
|
String communityId = ""; |
|
|
|
// 街道id
|
|
|
|
String streetId = ""; |
|
|
|
LambdaUpdateWrapper<XxxdEventEntity> updateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
updateWrapper.eq(XxxdEventEntity::getId, xxxdEventEntityId); |
|
|
|
try { |
|
|
|
// 查询网格信息
|
|
|
|
GisFormDTO gisFormDTO = new GisFormDTO(); |
|
|
|
gisFormDTO.setLongitude(longitude); |
|
|
|
gisFormDTO.setLatitude(latitude); |
|
|
|
Result<GisGridDTO> gisGridRes = adminFeignClient.getGridByCoordinate(gisFormDTO); |
|
|
|
if (!gisGridRes.success() || null == gisGridRes.getData()) { |
|
|
|
internalRemark = "根据经纬度获取网格信息失败:" + gisGridRes.getMsg(); |
|
|
|
// return;
|
|
|
|
}else{ |
|
|
|
gridId = String.valueOf(gisGridRes.getData().getGridId()); |
|
|
|
gridName = gisGridRes.getData().getGridName(); |
|
|
|
communityId = String.valueOf(gisGridRes.getData().getCommunityId()); |
|
|
|
streetId = String.valueOf(gisGridRes.getData().getStreetId()); |
|
|
|
|
|
|
|
// 调用北上诉办-民生诉求方法
|
|
|
|
submitItemFormDTO.setGridId(gisGridRes.getData().getGridId()); |
|
|
|
submitItemFormDTO.setGrid(gisGridRes.getData().getGridName()); |
|
|
|
} |
|
|
|
submitItemFormDTO.setGridId(1001L); |
|
|
|
submitItemFormDTO.setGrid("test"); |
|
|
|
|
|
|
|
bssbEventId = this.submitMsFzItemResiForXxxd(submitItemFormDTO); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
internalRemark="上传到民生诉求异常"; |
|
|
|
log.error("submitXxxdEventToItem上传到民生诉求异常",e); |
|
|
|
} finally { |
|
|
|
log.info("最终都会被执行-------------------"); |
|
|
|
updateWrapper.set(StringUtils.isNotBlank(internalStatus), XxxdEventEntity::getInternalStatus, internalStatus) |
|
|
|
.set(StringUtils.isNotBlank(bssbEventId), XxxdEventEntity::getBssbEventId, bssbEventId) |
|
|
|
.set(StringUtils.isNotBlank(internalRemark), XxxdEventEntity::getInternalRemark, internalRemark) |
|
|
|
.set(StringUtils.isNotBlank(gridId), XxxdEventEntity::getGridId, gridId) |
|
|
|
.set(StringUtils.isNotBlank(gridName), XxxdEventEntity::getGridName, gridName) |
|
|
|
.set(StringUtils.isNotBlank(communityId), XxxdEventEntity::getCommunityId, communityId) |
|
|
|
.set(StringUtils.isNotBlank(streetId), XxxdEventEntity::getStreetId, streetId); |
|
|
|
xxxdEventDao.update(null, updateWrapper); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|