Browse Source

话题insertOne 积分添加customerId

dev
wangchao 5 years ago
parent
commit
906ab6d097
  1. 1
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java
  2. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java
  3. 29
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  4. 6
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicAttachmentDao.xml
  5. 6
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml
  6. 6
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicOperationDao.xml

1
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java

@ -219,6 +219,7 @@ public class PointAdjustmentLogServiceImpl extends BaseServiceImpl<PointAdjustme
adjustmentEntity.setPoint(point);
adjustmentEntity.setOperatorAgencyId(agencyId);
adjustmentEntity.setUserId(param.getUserId());
adjustmentEntity.setCustomerId(param.getCustomerId());
//此处设置无效,会拦截到当前请求token中的userId,实际与这里的operatorId一致
adjustmentEntity.setCreatedBy(param.getOperatorId());
pointAdjustmentLogDao.insert(adjustmentEntity);

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java

@ -34,6 +34,7 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
@ -109,6 +110,9 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
@Autowired
ResiTopicDao resiTopicdDao;
@Autowired
LoginUserUtil loginUserUtil;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
@ -231,6 +235,8 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
ResiTopicCommentEntity comment = ConvertUtils.sourceToTarget(resiCommentFormDTO,ResiTopicCommentEntity.class);
comment.setStatus(TopicConstant.PUBLISHMENT);
comment.setCreatedBy(tokenDto.getUserId());
//2021/1/29 客户Id
comment.setCustomerId(loginUserUtil.getLoginUserCustomerId());
baseDao.insertOne(comment);
// 话题评论前3次,加积分【对小组内话题进行15字以上评论】
Integer commentCount = baseDao.selectCommentCountByUserId(tokenDto.getUserId());

29
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -38,6 +38,7 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.OrgInfoConstant;
@ -102,7 +103,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jsoup.helper.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -177,6 +177,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
@ -310,9 +313,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
logger.error(ModuleConstant.TOPIC_CONTENT_NUMBER_OF_WORDS_EXCEEDED);
throw new RenException(ModuleConstant.TOPIC_CONTENT_NUMBER_OF_WORDS_EXCEEDED);
}
String customerId = loginUserUtil.getLoginUserCustomerId();
ResiTopicEntity topic = ConvertUtils.sourceToTarget(resiTopicPublishFormDTO,ResiTopicEntity.class);
topic.setCreatedBy(tokenDto.getUserId());
topic.setStatus(TopicConstant.PUBLISHMENT);
//2021/1/29 客户Id
topic.setCustomerId(customerId);
baseDao.insertOne(topic);
if(StringUtils.isBlank(topic.getId())){
//没有返回主键
@ -329,6 +337,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setSort(sort++);
attachment.setAttachmentType("image");
//2021/1/29 客户Id
attachment.setCustomerId(customerId);
resiTopicAttachmentDao.insertOne(attachment);
}
}
@ -338,6 +348,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
operation.setTopicId(topic.getId());
operation.setOperationType(TopicConstant.PUBLISHMENT);
operation.setCreatedBy(tokenDto.getUserId());
//2021/1/29 客户Id
operation.setCustomerId(customerId);
resiTopicOperationDao.insertOne(operation);
@ -356,6 +368,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
statistical2Update.setTotalTopics(null == statistical.get(NumConstant.ZERO).getTotalTopics() ? NumConstant.ONE : statistical.get(NumConstant.ZERO).getTotalTopics() + NumConstant.ONE);
statistical2Update.setUpdatedBy(tokenDto.getUserId());
statistical2Update.setUpdatedTime(currentTime);
//2021/1/29 客户Id
statistical2Update.setCustomerId(customerId);
resiGroupStatisticalDao.updateById(statistical2Update);
}
}else{
@ -369,6 +383,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
ResiGroupEntity group2Update = new ResiGroupEntity();
group2Update.setId(resiTopicPublishFormDTO.getGroupId());
group2Update.setLatestTopicPublishDate(currentTime);
//2021/1/29 客户Id
group2Update.setCustomerId(customerId);
resiGroupDao.updateById(group2Update);
// 创建话题增加积分
@ -556,12 +572,17 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
topicForUpdate.setUpdatedBy(tokenDto.getUserId());
topicForUpdate.setStatus(TopicConstant.HIDDEN);
baseDao.update(topicForUpdate);
String customerId = loginUserUtil.getLoginUserCustomerId();
//3.话题操作记录
ResiTopicOperationEntity operationRecord = new ResiTopicOperationEntity();
operationRecord.setTopicId(hiddenFormDTO.getTopicId());
operationRecord.setOperationReason(hiddenFormDTO.getOperateReason());
operationRecord.setOperationType(TopicConstant.HIDDEN);
operationRecord.setCreatedBy(tokenDto.getUserId());
//2021/1/29 客户Id
operationRecord.setCustomerId(customerId);
resiTopicOperationDao.insertOne(operationRecord);
// 4.组话题数量-1 (对应的在解除屏蔽时组话题数量+1)
@ -618,6 +639,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
operation.setTopicId(id);
operation.setOperationType(TopicConstant.CANCEL_HIDDEN);
operation.setCreatedBy(tokenDto.getUserId());
operation.setCustomerId(loginUserUtil.getLoginUserCustomerId());
resiTopicOperationDao.insertOne(operation);
}
QueryWrapper<ResiGroupStatisticalEntity> statisticalWrapper = new QueryWrapper<>();
@ -678,6 +700,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
operation.setOperationReason(closeFormDTO.getOperateReason());
operation.setCreatedBy(tokenDto.getUserId());
operation.setOperationType(TopicConstant.CLOSED);
//2021/1/29 客户Id
operation.setCustomerId(loginUserUtil.getLoginUserCustomerId());
resiTopicOperationDao.insertOne(operation);
return new Result();
@ -975,6 +999,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
List<String> ids = new ArrayList<>();
List<ResiTopicOperationEntity> topicOperationList = new ArrayList<>();
ResiTopicOperationEntity resiTopicOperationEntity = null;
//2021/1/29 客户Id
String customerId = loginUserUtil.getLoginUserCustomerId();
for (ResiTopicDTO dto : list) {
ids.add(dto.getId());
resiTopicOperationEntity = new ResiTopicOperationEntity();
@ -985,6 +1011,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
resiTopicOperationEntity.setRevision(NumConstant.ZERO);
resiTopicOperationEntity.setCreatedBy(removeMemberFormDTO.getUserId());
resiTopicOperationEntity.setUpdatedBy(removeMemberFormDTO.getUserId());
resiGroupMemberEntity.setCustomerId(customerId);
topicOperationList.add(resiTopicOperationEntity);
}
baseDao.cancelHiddenOrCloseBatch(ids, removeMemberFormDTO.getUserId(),TopicConstant.HIDDEN);

6
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicAttachmentDao.xml

@ -30,6 +30,9 @@
<if test='null != sort'>
sort,
</if>
<if test='null != customerId and "" != customerId'>
customer_id,
</if>
<if test ='null != createdBy'>
created_by,
</if>
@ -59,6 +62,9 @@
<if test='null != sort'>
#{sort},
</if>
<if test='null != customerId and "" != customerId'>
#{customerId},
</if>
<if test ='null != createdBy'>
#{createdBy},
</if>

6
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml

@ -58,6 +58,9 @@
<if test ='null != dimension'>
dimension,
</if>
<if test='null != customerId and "" != customerId'>
customer_id,
</if>
<if test ='null != createdBy'>
created_by,
</if>
@ -97,6 +100,9 @@
<if test ='null != dimension'>
#{dimension},
</if>
<if test='null != customerId and "" != customerId'>
#{customerId},
</if>
<if test ='null != createdBy'>
#{createdBy},
</if>

6
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicOperationDao.xml

@ -22,6 +22,9 @@
<if test='null != operationReason'>
operation_reason,
</if>
<if test='null != customerId and "" != customerId'>
customer_id,
</if>
<if test ='null != createdBy'>
created_by,
</if>
@ -42,6 +45,9 @@
<if test='null != operationReason'>
#{operationReason},
</if>
<if test='null != customerId and "" != customerId'>
#{customerId},
</if>
<if test ='null != createdBy'>
#{createdBy},
</if>

Loading…
Cancel
Save