|
|
|
@ -968,6 +968,16 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
itemEntity.setEvaluationScore(evaluationFormDTO.getEvaluationScore()); |
|
|
|
itemEntity.setEvaluationContent(evaluationFormDTO.getEvaluationContent()); |
|
|
|
itemEntity.setEvaluationTime(new Date()); |
|
|
|
//2022.10.24 评价接口增加第一次评价不管第二次为满意时不管为不满意时将数据推到难点堵点的逻辑
|
|
|
|
if(evaluationFormDTO.getEvaluationScore()==0){ |
|
|
|
QueryWrapper<ItemCommentFeedbackEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq("item_id", evaluationFormDTO.getItemId()); |
|
|
|
wrapper.eq("del_flag", "0"); |
|
|
|
List<ItemCommentFeedbackEntity> iEntityList = itemCommentFeedbackDao.selectList(wrapper); |
|
|
|
if (CollUtil.isNotEmpty(iEntityList)) { |
|
|
|
itemEntity.setIsDifficulty("1"); |
|
|
|
} |
|
|
|
} |
|
|
|
baseDao.updateById(itemEntity); |
|
|
|
|
|
|
|
//内容审核接口异常,保存至待审核信息
|
|
|
|
@ -4192,17 +4202,19 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
* 定时任务:是否可以结案处理 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void ItemClosed(String itemId) { |
|
|
|
public void itemClosed(String itemId) { |
|
|
|
//1.获取项目基础数据
|
|
|
|
ItemEntity entity = baseDao.selectById(itemId); |
|
|
|
if (null == entity) { |
|
|
|
throw new RenException("获取项目数据失败,项目Id->" + itemId); |
|
|
|
} |
|
|
|
//2.判断是否已结案(第二次可以评价了,没超过24小时用户评价了,此时就是已结案了)
|
|
|
|
if ("10".equals(entity.getItemState())) { |
|
|
|
//2.判断是发展、执法诉求的不作处理(这两个诉求项目必须走诉求初验终验逻辑);判断是已结案的不做处理(第二次可以评价了,没超过24小时用户评价了,此时就是已结案了)
|
|
|
|
if (!"0".equals(entity.getPeopleFlag()) || "10".equals(entity.getItemState())) { |
|
|
|
logger.info("当前诉求不做结案处理,原因:诉求分类PeopleFlag->" + entity.getPeopleFlag() + ",诉求状态itemState->" + entity.getItemState()); |
|
|
|
return; |
|
|
|
} |
|
|
|
//3.判断评价结果,未评价的赋值为满意并且结案给网格化平台推送结果;已评价的结果为满意直接结案给网格化推结果,不满意直接给网格化推结果
|
|
|
|
ItemHandleProcessDTO processDTO = new ItemHandleProcessDTO(); |
|
|
|
if (null == entity.getEvaluationScore() || 0 != entity.getEvaluationScore()) { |
|
|
|
//3-1.未评价的或评价结果不是不满意的则需要结案
|
|
|
|
QueryWrapper<ItemGridPlatformEntity> wrapper = new QueryWrapper<>(); |
|
|
|
@ -4243,10 +4255,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
dto.setCantoncode(hEntity.getGridCantoncode()); |
|
|
|
dto.setImages(imgUrlList); |
|
|
|
dto.setCreatedTime(hEntity.getCreatedTime()); |
|
|
|
Result result = pushItemProcess(dto); |
|
|
|
if (!result.success()) { |
|
|
|
throw new RenException("结案操作失败,项目id->" + itemId); |
|
|
|
} |
|
|
|
processDTO = closedItem(dto); |
|
|
|
//3-2.未评价的赋值默认评价结果为满意
|
|
|
|
if (null == entity.getEvaluationScore()) { |
|
|
|
entity.setEvaluationScore(2); |
|
|
|
@ -4257,9 +4266,108 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
updateById(entity); |
|
|
|
} |
|
|
|
|
|
|
|
//4.推送评价结果给网格化平台
|
|
|
|
//TODO
|
|
|
|
//4.市平台推送数据
|
|
|
|
//4-1.诉求评价
|
|
|
|
pushToCityGridService.evaluation(itemId); |
|
|
|
//4-2.诉求结案
|
|
|
|
pushToCityGridService.caseClosedSentoCity(processDTO.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ItemHandleProcessDTO closedItem(AcceptPlantformProcessDTO formDto) { |
|
|
|
String successFlag = YesOrNoEnum.NO.value(); |
|
|
|
String returnMsgBody = ""; |
|
|
|
ItemGridPlatformDTO itemPlat = itemGridPlatformService.getInfoByTaskId(formDto.getP_recId()); |
|
|
|
if (null == itemPlat) { |
|
|
|
// 保存接口调用日志
|
|
|
|
this.saveInterfaceLog("", InterfaceLogBusinessTypeEnum.ACCEPT_ITEM_PROCESS.getValue(), |
|
|
|
ApiConstants.acceptItemProcess, successFlag, formDto.getP_recId(), returnMsgBody); |
|
|
|
logger.error("未查到相关事件信息"); |
|
|
|
} |
|
|
|
// 插入项目处理进度表
|
|
|
|
String firstHandleId = ""; |
|
|
|
ItemHandleProcessDTO itemHandleProcessDto = new ItemHandleProcessDTO(); |
|
|
|
itemHandleProcessDto.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
|
|
|
itemHandleProcessDto.setItemId(itemPlat.getReferenceId()); |
|
|
|
//组装处理人及部门相关字段
|
|
|
|
itemHandleProcessDto.setGridPartyid(formDto.getGridPartyid()); |
|
|
|
itemHandleProcessDto.setGridPartyname(formDto.getGridPartyname()); |
|
|
|
itemHandleProcessDto.setGridUnitid(formDto.getGridUnitid()); |
|
|
|
itemHandleProcessDto.setGridUnitname(formDto.getGridUnitname()); |
|
|
|
itemHandleProcessDto.setGridCantoncode(formDto.getCantoncode()); |
|
|
|
//根据网格化区域编码获取对应的市中心区域编码
|
|
|
|
if (StringUtils.isNotBlank(itemHandleProcessDto.getGridCantoncode())) { |
|
|
|
Result<SysDeptAreaCodeResultDTO> result = adminFeignClient.getZoneCode(itemHandleProcessDto.getGridCantoncode()); |
|
|
|
SysDeptAreaCodeResultDTO dept = result.getData(); |
|
|
|
if (dept != null) { |
|
|
|
String zoneCode = dept.getDisCenterZoningCode(); |
|
|
|
itemHandleProcessDto.setDisCenterZoningCode(zoneCode); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("0".equals(formDto.getState())) { |
|
|
|
ItemEntity item = baseDao.selectById(itemPlat.getReferenceId()); |
|
|
|
log.info("根据id查询数据"); |
|
|
|
itemHandleProcessDto.setState(ItemGridPlatformHandleStatusEnum.HANDLE_JA.getValue()); |
|
|
|
//判断最后一条处理进展是吹哨还是结案,结案:取第一条处置意见;吹哨:取平台处置意见
|
|
|
|
if ("1".equals(item.getPeopleFlag()) || "2".equals(item.getPeopleFlag())) { |
|
|
|
//执法和发展填写网格化平台的意见
|
|
|
|
itemHandleProcessDto.setOutHandleAdvice(formDto.getHandleAdvice()); |
|
|
|
} else if (getItemIsCs(itemPlat.getReferenceId())) { |
|
|
|
//吹哨
|
|
|
|
itemHandleProcessDto.setOutHandleAdvice(formDto.getHandleAdvice() + "h_s办理人:" + item.getHandlePeopleName() + ",联系电话:" + item.getHandlePeopleMobile()); |
|
|
|
} else { |
|
|
|
//内容组成:第一个发起结案申请+办理人:XXX+办理电话:XXX。换行(前端处理) 感谢您的支持,“北尚诉办”全程为您服务!没有结案申请就取网格化结案状态流程数据
|
|
|
|
ItemHandleProcessEntity firsthandleProcess = baseDao.selectFirstHandleProcessByItemId(itemPlat.getReferenceId(), ItemGridPlatformHandleStatusEnum.HANDLE_SQ.getValue()); |
|
|
|
if (firsthandleProcess == null) { |
|
|
|
firsthandleProcess = baseDao.selectFirstHandleProcessByItemId(itemPlat.getReferenceId(), ItemGridPlatformHandleStatusEnum.HANDLE_JA.getValue()); |
|
|
|
if (firsthandleProcess == null) { |
|
|
|
itemHandleProcessDto.setOutHandleAdvice("办理人:" + item.getHandlePeopleName() + ",联系电话:" + item.getHandlePeopleMobile()); |
|
|
|
} else { |
|
|
|
firstHandleId = firsthandleProcess.getId(); |
|
|
|
itemHandleProcessDto.setOutHandleAdvice(firsthandleProcess.getHandleAdvice() + "h_s办理人:" + item.getHandlePeopleName() + ",联系电话:" + item.getHandlePeopleMobile()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
firstHandleId = firsthandleProcess.getId(); |
|
|
|
itemHandleProcessDto.setOutHandleAdvice(firsthandleProcess.getHandleAdvice() + "h_s办理人:" + item.getHandlePeopleName() + ",联系电话:" + item.getHandlePeopleMobile()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
itemHandleProcessDto.setGridPartyname("结案"); |
|
|
|
itemHandleProcessDto.setGridTaskcnname("区中心"); |
|
|
|
item.setItemState(ItemHandleCategoryEnum.HANDLE_CLOSING_CASE.getValue()); |
|
|
|
// 可以进行评价了,默认评分-满意
|
|
|
|
item.setEvaluationScore(ItemEvaluationLevel.LEVALUATION_LEVEL_BETTER); |
|
|
|
item.setEvaluationState(NumConstant.ONE_STR); |
|
|
|
updateById(item); |
|
|
|
} |
|
|
|
itemHandleProcessDto.setHandleAdvice(formDto.getHandleAdvice()); |
|
|
|
itemHandleProcessDto.setHandlerDept("网格化平台"); |
|
|
|
itemHandleProcessDto.setCreatedTime(null == formDto.getCreatedTime() ? new Date() : formDto.getCreatedTime()); |
|
|
|
itemHandleProcessDto.setUpdatedTime(new Date()); |
|
|
|
itemHandleProcessService.saveItemHandleProcess(itemHandleProcessDto); |
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(firstHandleId)){ |
|
|
|
// 插入第一级结案申请时的图片
|
|
|
|
List<ImgEntity> imageList = imgDao.selectListByRefeId(firstHandleId); |
|
|
|
for(ImgEntity imgEntity : imageList){ |
|
|
|
imgEntity.setId(null); |
|
|
|
imgEntity.setReferenceId(itemHandleProcessDto.getId()); |
|
|
|
imgDao.insert(imgEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//项目处理意见图片保存
|
|
|
|
if (formDto.getImages() != null && formDto.getImages().size() > 0) { |
|
|
|
imgService.saveImages(formDto.getImages(), itemHandleProcessDto.getId(), ImageConstant.TYPE_IMAGE_ITEM_OUT_HANDLE); |
|
|
|
} |
|
|
|
successFlag = YesOrNoEnum.YES.value(); |
|
|
|
// 保存接口调用日志
|
|
|
|
String message = formDto.getP_recId(); |
|
|
|
message = message + ":" + formDto; |
|
|
|
this.saveInterfaceLog(itemPlat.getReferenceId(), InterfaceLogBusinessTypeEnum.ACCEPT_ITEM_PROCESS.getValue(), |
|
|
|
ApiConstants.acceptItemProcess, successFlag, message, returnMsgBody); |
|
|
|
return itemHandleProcessDto; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|