|
|
|
@ -240,57 +240,6 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl<Projec |
|
|
|
baseDao.insert(entity); |
|
|
|
// 更新
|
|
|
|
statisticsDao.updateEvaluateData(formDTO.getProjectId(), formDTO.getSatisfaction()); |
|
|
|
|
|
|
|
/*RLock lock = null; |
|
|
|
try { |
|
|
|
lock = distributedLock.getLock("evaluate_project"); |
|
|
|
if (null != lock){ |
|
|
|
ProjectEntity projectEntity = projectDao.selectById(formDTO.getProjectId()); |
|
|
|
if (null == projectEntity){ |
|
|
|
throw new RenException("未查询到项目信息"); |
|
|
|
} |
|
|
|
// 应评价数 = 话题创建者 + 议题发起者 + 议题表决人 【去重】
|
|
|
|
// 议题发起者 和 议题表决人 和 话题创建者 查询
|
|
|
|
Result<List<String>> canEvaluateProjectCount = govIssueOpenFeignClient.canEvaluateProjectCount(projectEntity.getOriginId()); |
|
|
|
if (!canEvaluateProjectCount.success()){ |
|
|
|
throw new RenException("【查询项目应评价人数失败】,【"+canEvaluateProjectCount.getMsg()+"】"); |
|
|
|
} |
|
|
|
List<String> userIds = canEvaluateProjectCount.getData(); |
|
|
|
// 校验此项目记录是否存在
|
|
|
|
Integer count = statisticsDao.checkProjectExists(formDTO.getProjectId()); |
|
|
|
if (count == NumConstant.ZERO){ |
|
|
|
ProjectSatisfactionStatisticsEntity entity1 = new ProjectSatisfactionStatisticsEntity(); |
|
|
|
entity1.setShouldEvaluateCount(userIds.size()); |
|
|
|
entity1.setCustomerId(formDTO.getCustomerId()); |
|
|
|
entity1.setProjectId(formDTO.getProjectId()); |
|
|
|
entity1.setBadCount(NumConstant.ZERO); |
|
|
|
entity1.setGoodCount(NumConstant.ZERO); |
|
|
|
entity1.setPerfectCount(NumConstant.ZERO); |
|
|
|
switch (formDTO.getSatisfaction()){ |
|
|
|
case ProjectConstant.EVALUATE_BAD: |
|
|
|
entity1.setBadCount(NumConstant.ONE); |
|
|
|
break; |
|
|
|
case ProjectConstant.EVALUATE_GOOD: |
|
|
|
entity1.setGoodCount(NumConstant.ONE); |
|
|
|
break; |
|
|
|
case ProjectConstant .EVALUATE_PERFECT: |
|
|
|
entity1.setPerfectCount(NumConstant.ONE); |
|
|
|
default: |
|
|
|
} |
|
|
|
// 新添一条记录
|
|
|
|
statisticsDao.insert(entity1); |
|
|
|
}else { |
|
|
|
// 更新
|
|
|
|
statisticsDao.updateEvaluateData(formDTO.getProjectId(), formDTO.getSatisfaction()); |
|
|
|
} |
|
|
|
} |
|
|
|
}catch (Exception e){ |
|
|
|
throw new RenException(e.getMessage()); |
|
|
|
}finally { |
|
|
|
if (lock != null){ |
|
|
|
lock.unlock(); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|