diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java index 3c1b72151a..583a0c0e61 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java @@ -589,45 +589,47 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl{ - //1.新增用户积分行为记录 - UserPointActionLogEntity action = new UserPointActionLogEntity(); - action.setCustomerId(grantPoint.getCustomerId()); - action.setPoint(grantPoint.getPoint()); - //完成了XXX的需求 - action.setEventStatement(grantPoint.getRemark()); - //需求分类表中一级分类的名称 - action.setEventId(EventEnum.FINISH_USER_DEMAND.getEventTag()); - action.setActionFlag(grantPoint.getActionFlag()); - action.setUserId(grantPoint.getUserId()); - action.setCreatedBy(grantPoint.getOperatorId()); - action.setUpdatedBy(grantPoint.getOperatorId()); - action.setSourceType(grantPoint.getSourceType()); - action.setSourceId(grantPoint.getSourceId()); - // 需求所属分类编码,对应objectId - action.setObjectId(grantPoint.getObjectId()); - //需求所属分类-一级分类名称 - action.setEventName(grantPoint.getEventName()); - baseDao.insert(action); - //2.新增/修改用户积分日统计 - DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date()); - UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal,UserPointStatisticalDailyEntity.class); - statistical.setPointChange(grantPoint.getPoint()); - statistical.setActionFlag(grantPoint.getActionFlag()); - statistical.setCustomerId(grantPoint.getCustomerId()); - statistical.setUserId(grantPoint.getUserId()); - statistical.setCreatedBy(grantPoint.getOperatorId()); - statistical.setUpdatedBy(grantPoint.getOperatorId()); - userPointStatisticalDailyService.insertOrUpdate(statistical); - //3.新增/修改用户积分日统计 - UserPointTotalEntity point = new UserPointTotalEntity(); - point.setCustomerId(grantPoint.getCustomerId()); - point.setUserId(grantPoint.getUserId()); - point.setTotalPoint(grantPoint.getPoint()); - point.setUsablePoint(grantPoint.getPoint()); - point.setUsedPoint(NumConstant.ZERO); - point.setCreatedBy(grantPoint.getOperatorId()); - point.setUpdatedBy(grantPoint.getOperatorId()); - userPointTotalService.insertOrUpdate(point); + if (null != grantPoint.getPoint()) { + //1.新增用户积分行为记录 + UserPointActionLogEntity action = new UserPointActionLogEntity(); + action.setCustomerId(grantPoint.getCustomerId()); + action.setPoint(grantPoint.getPoint()); + //完成了XXX的需求 + action.setEventStatement(grantPoint.getRemark()); + //需求分类表中一级分类的名称 + action.setEventId(EventEnum.FINISH_USER_DEMAND.getEventTag()); + action.setActionFlag(grantPoint.getActionFlag()); + action.setUserId(grantPoint.getUserId()); + action.setCreatedBy(grantPoint.getOperatorId()); + action.setUpdatedBy(grantPoint.getOperatorId()); + action.setSourceType(grantPoint.getSourceType()); + action.setSourceId(grantPoint.getSourceId()); + // 需求所属分类编码,对应objectId + action.setObjectId(grantPoint.getObjectId()); + //需求所属分类-一级分类名称 + action.setEventName(grantPoint.getEventName()); + baseDao.insert(action); + //2.新增/修改用户积分日统计 + DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date()); + UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal, UserPointStatisticalDailyEntity.class); + statistical.setPointChange(grantPoint.getPoint()); + statistical.setActionFlag(grantPoint.getActionFlag()); + statistical.setCustomerId(grantPoint.getCustomerId()); + statistical.setUserId(grantPoint.getUserId()); + statistical.setCreatedBy(grantPoint.getOperatorId()); + statistical.setUpdatedBy(grantPoint.getOperatorId()); + userPointStatisticalDailyService.insertOrUpdate(statistical); + //3.新增/修改用户积分日统计 + UserPointTotalEntity point = new UserPointTotalEntity(); + point.setCustomerId(grantPoint.getCustomerId()); + point.setUserId(grantPoint.getUserId()); + point.setTotalPoint(grantPoint.getPoint()); + point.setUsablePoint(grantPoint.getPoint()); + point.setUsedPoint(NumConstant.ZERO); + point.setCreatedBy(grantPoint.getOperatorId()); + point.setUpdatedBy(grantPoint.getOperatorId()); + userPointTotalService.insertOrUpdate(point); + } }); } } \ No newline at end of file