Browse Source

Merge remote-tracking branch 'origin/dev_ic_mp' into develop

master
yinzuomei 4 years ago
parent
commit
83f290446c
  1. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
  2. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  3. 80
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java

@ -77,5 +77,5 @@ public interface UserDemandConstant {
String DEMAND_PUBLISHER="publisher";
String DEMAND_SERVER="server";
String GRANT_POINT_REMARK="完成了%s的需求";
String GRANT_POINT_REMARK="完成了%s的需求:%s";
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -453,7 +453,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}else{
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getParentCode()));
}
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName()));
String content = entity.getContent().length() > 100 ? entity.getContent().substring(0, 99) : entity.getContent();
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content));
}
//4、修改主表状态为已完成
@ -1089,7 +1090,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}else{
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getParentCode()));
}
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName()));
String content = entity.getContent().length() > 100 ? entity.getContent().substring(0, 99) : entity.getContent();
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content));
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自XXX(需求人姓名)的评价,请查看。
sendVolunnterEvaluated(entity);
return finishResultDTO;

80
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<UserPointActi
return;
}
list.forEach(grantPoint->{
//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);
}
});
}
}
Loading…
Cancel
Save