Browse Source

heart:bug修改

master
yinzuomei 5 years ago
parent
commit
4c28336db0
  1. 63
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/TestGrantFormDTO.java
  2. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
  4. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

63
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/TestGrantFormDTO.java

@ -0,0 +1,63 @@
package com.epmet.dto.form.work;
import com.alibaba.fastjson.JSON;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/30 12:15
*/
@Data
public class TestGrantFormDTO implements Serializable {
private static final long serialVersionUID = -2643821406956680381L;
public interface AddUserInternalGroup {}
/**
* 当前客户id
*/
@NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class)
private String customerId;
/**
* 居民id
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
/**
* 分值
*/
@NotNull(message = "分值不能为空",groups = AddUserInternalGroup.class)
private Integer reward;
/**
* 业务id eg活动id
*/
@NotBlank(message = "业务id不能为空",groups = AddUserInternalGroup.class)
private String sourceId;
/**
* 备注
*/
@NotBlank(message = "备注不能为空",groups = AddUserInternalGroup.class)
private String remark;
/**
* 加减分标识 plus/minus
*/
@NotBlank(message = "加减分标识 plus/minus不能为空",groups = AddUserInternalGroup.class)
private String actionFlag;
TestGrantFormDTO(){
this.customerId="";
this.userId="";
this.sourceId="111";
this.reward=20;
this.remark="test";
this.actionFlag="plus";
}
public static void main(String[] args) {
System.out.println(JSON.toJSON(new TestGrantFormDTO()));
}
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java

@ -190,6 +190,12 @@ public class WorkActController {
return new Result();
}
@PostMapping("testgrantpoint")
public Result testGrantPoint(@RequestBody TestGrantFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,TestGrantFormDTO.AddUserInternalGroup.class);
workActService.testGrantPoint(formDTO);
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java

@ -146,4 +146,6 @@ public interface WorkActService {
* @Date 2020/7/27 13:55
**/
PublishActResultDTO rePublish(RePublishFormDTO rePublishFormDTO);
void testGrantPoint(TestGrantFormDTO formDTO);
}

34
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -873,6 +873,39 @@ public class WorkActServiceImpl implements WorkActService {
}
}
@Override
public void testGrantPoint(TestGrantFormDTO formDTO) {
//查询当前用户所属组织信息
Result<CustomerAgencyDTO> userResult = govOrgOpenFeignClient.getAgencyByStaff(loginUserUtil.getLoginUserId());
String opAgencyId = userResult.getData().getId();
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
//mq的事件类型
mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
//事件code
mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
List<BasePointEventMsg> basePointEventMsgArrayList = new ArrayList<>();
BasePointEventMsg basePointEventMsg = new BasePointEventMsg();
basePointEventMsg.setOpAgencyId(opAgencyId);
basePointEventMsg.setCustomerId(formDTO.getCustomerId());
basePointEventMsg.setUserId(formDTO.getUserId());
basePointEventMsg.setActionFlag(formDTO.getActionFlag());
basePointEventMsg.setPoint(formDTO.getReward());
basePointEventMsg.setIsCommon(true);
basePointEventMsg.setRemark(formDTO.getRemark());
basePointEventMsg.setSourceId(formDTO.getSourceId());
basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId());
basePointEventMsgArrayList.add(basePointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
logger.info("发送消息入参:"+JSON.toJSON(mqBaseMsgDTO));
Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
logger.info("发送消息返参:"+JSON.toJSON(result));
if (!result.success()) {
logger.error("积分发放失败");
return;
}
logger.info("积分发方成功");
}
private void updateHeartUserInfo(ActInfoDTO actInfoDTO) {
List<ActUserRelationDTO> actUserRelationDTOList=actUserRelationService.getUserList(actInfoDTO.getId(),StrConstant.EPMETY_STR);
for(ActUserRelationDTO actUserRelation:actUserRelationDTOList){
@ -1082,6 +1115,7 @@ public class WorkActServiceImpl implements WorkActService {
return publishActResultDTO;
}
private void noticePassedPeople(ActInfoDTO originalActInfo, ActInfoEntity newActInfoEntity) {
/* List<ActUserRelationDTO> actUserRelationDTOList=actUserRelationDao.selectAuditingAndPassedList(originalActInfo.getId());
if(null==actUserRelationDTOList||actUserRelationDTOList.size()<1){

Loading…
Cancel
Save