|
|
@ -17,6 +17,7 @@ |
|
|
|
|
|
|
|
|
package com.elink.esua.epdc.modules.item.service.impl; |
|
|
package com.elink.esua.epdc.modules.item.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
@ -4066,4 +4067,80 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 定时任务:是否可以结案处理 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
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())){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
//3.判断评价结果,未评价的赋值为满意并且结案给网格化平台推送结果;已评价的结果为满意直接结案给网格化推结果,不满意直接给网格化推结果
|
|
|
|
|
|
if(null == entity.getEvaluationScore() || 0 != entity.getEvaluationScore()){ |
|
|
|
|
|
//3-1.未评价的或评价结果不是不满意的则需要结案
|
|
|
|
|
|
QueryWrapper<ItemGridPlatformEntity> wrapper = new QueryWrapper<>(); |
|
|
|
|
|
wrapper.eq("reference_id", itemId); |
|
|
|
|
|
wrapper.eq("del_flag", "0"); |
|
|
|
|
|
wrapper.orderByDesc(FieldConstant.CREATED_TIME); |
|
|
|
|
|
wrapper.last("limit 1"); |
|
|
|
|
|
ItemGridPlatformEntity formEntity = itemGridPlatformDao.selectOne(wrapper); |
|
|
|
|
|
if(null == formEntity){ |
|
|
|
|
|
throw new RenException("获取项目与网格化平台关系数据失败,项目Id->"+itemId); |
|
|
|
|
|
} |
|
|
|
|
|
QueryWrapper<ItemHandleProcessEntity> hWrapper = new QueryWrapper<>(); |
|
|
|
|
|
hWrapper.eq("item_id", itemId); |
|
|
|
|
|
hWrapper.eq("state", "1105"); |
|
|
|
|
|
hWrapper.eq("del_flag", "0"); |
|
|
|
|
|
hWrapper.orderByDesc(FieldConstant.CREATED_TIME); |
|
|
|
|
|
hWrapper.last("limit 1"); |
|
|
|
|
|
ItemHandleProcessEntity hEntity = itemHandleProcessDao.selectOne(hWrapper); |
|
|
|
|
|
if(null == hEntity){ |
|
|
|
|
|
throw new RenException("获取项目流程节点数据失败,项目Id->"+itemId); |
|
|
|
|
|
} |
|
|
|
|
|
QueryWrapper<ImgEntity> iWrapper = new QueryWrapper<>(); |
|
|
|
|
|
iWrapper.eq("reference_id", hEntity.getId()); |
|
|
|
|
|
iWrapper.eq("del_flag", "0"); |
|
|
|
|
|
List<ImgEntity> iEntityList = imgDao.selectList(iWrapper); |
|
|
|
|
|
if(CollUtil.isEmpty(iEntityList)){ |
|
|
|
|
|
throw new RenException("获取项目流程节点对应的图片数据失败,节点Id->"+hEntity.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
List<String> imgUrlList = iEntityList.stream().map(ImgEntity::getImgUrl).collect(Collectors.toList()); |
|
|
|
|
|
AcceptPlantformProcessDTO dto = new AcceptPlantformProcessDTO(); |
|
|
|
|
|
dto.setP_recId(formEntity.getTaskid()); |
|
|
|
|
|
dto.setState("0"); |
|
|
|
|
|
dto.setHandleAdvice(hEntity.getHandleAdvice()); |
|
|
|
|
|
dto.setGridPartyid(hEntity.getGridPartyid()); |
|
|
|
|
|
dto.setGridPartyname(hEntity.getGridPartyname()); |
|
|
|
|
|
dto.setGridUnitid(hEntity.getGridUnitid()); |
|
|
|
|
|
dto.setGridUnitname(hEntity.getGridUnitname()); |
|
|
|
|
|
dto.setCantoncode(hEntity.getGridCantoncode()); |
|
|
|
|
|
dto.setImages(imgUrlList); |
|
|
|
|
|
dto.setCreatedTime(hEntity.getCreatedTime()); |
|
|
|
|
|
Result result = pushItemProcess(dto); |
|
|
|
|
|
if (!result.success()) { |
|
|
|
|
|
throw new RenException("结案操作失败,项目id->"+itemId); |
|
|
|
|
|
} |
|
|
|
|
|
//3-2.未评价的赋值默认评价结果为满意
|
|
|
|
|
|
if(null == entity.getEvaluationScore()){ |
|
|
|
|
|
entity.setEvaluationScore(2); |
|
|
|
|
|
//entity.setEvaluationContent();
|
|
|
|
|
|
entity.setEvaluationTime(hEntity.getCreatedTime()); |
|
|
|
|
|
} |
|
|
|
|
|
entity.setEvaluationState("0"); |
|
|
|
|
|
updateById(entity); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//4.推送评价结果给网格化平台
|
|
|
|
|
|
//TODO
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|