Commit 318cf19f by 林冲

Merge remote-tracking branch 'origin/v5.6.0' into v5.6.0

2 parents 027f65c0 fc3ef0f0
......@@ -51,4 +51,7 @@ public class EffectiveReferralReviewCommonDTO extends EffectiveReferralReview {
@ApiModelProperty(value = "主键ids,无须前端传")
private List<Integer> ids;
@ApiModelProperty(value = "操作人id")
private String updatedById;
}
\ No newline at end of file
......@@ -23,7 +23,13 @@ public class StoreEffectiveReferralSubmitDTO implements Serializable {
@ApiModelProperty(value = "品牌有效引荐数DTOs")
private List<EffectiveReferralCountDTO> effectiveReferralCountDTOS;
@ApiModelProperty(value = "操作人id")
private String updatedById;
@ApiModelProperty(value = "操作人")
private String updatedBy;
@ApiModelProperty(value = "操作人手机号")
private String phone;
}
......@@ -183,18 +183,19 @@ public class EffectiveReferralReviewMiniProgramService {
public Boolean effectiveReferralStoreSubmit(StoreEffectiveReferralSubmitDTO dto) {
//1、根据id查询引荐数
EffectiveReferralReviewCommonDTO commonDTO = new EffectiveReferralReviewCommonDTO();
List<Integer> ids = dto.getEffectiveReferralCountDTOS().stream().map(EffectiveReferralCountDTO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ids)) {
throw new RpcServiceException("主键id不能为空");
}
EffectiveReferralReviewCommonDTO commonDTO = new EffectiveReferralReviewCommonDTO();
commonDTO.setIds(ids);
List<EffectiveReferralReviewCommonDTO> referralReviewCommonDTOS = effectiveReferralReviewMapper.selectStoreEffectiveReferralList(commonDTO);
//将referralReviewCommonDTOS转化为key-value,key为id,value为EffectiveReferralReviewCommonDTO
//2、将referralReviewCommonDTOS转化为key-value,key为id,value为EffectiveReferralReviewCommonDTO
Map<Integer, EffectiveReferralReviewCommonDTO> referralReviewCommonDTOSMap =
referralReviewCommonDTOS.stream().collect(Collectors.toMap(EffectiveReferralReviewCommonDTO::getId, item -> item));
//2、根据id更新引荐数、上传凭证、备注、状态
//3、根据id更新引荐数、上传凭证、备注、状态
dto.getEffectiveReferralCountDTOS().forEach(
item -> {
EffectiveReferralReview review = new EffectiveReferralReview();
......@@ -206,12 +207,19 @@ public class EffectiveReferralReviewMiniProgramService {
if (StringUtils.isNotBlank(dto.getRemark())) {
review.setRemark(dto.getRemark());
}
if (referralReviewCommonDTOSMap.containsKey(item.getId()) &&
!item.getEffectiveReferralCount().equals(referralReviewCommonDTOSMap.get(item.getId()).getTotalDeliveryCount())) {
if (referralReviewCommonDTOSMap.containsKey(item.getId())
&& !item.getEffectiveReferralCount().equals(referralReviewCommonDTOSMap.get(item.getId()).getTotalDeliveryCount())) {
review.setIsNeedReviewed(1);
review.setIsReviewed(0);
}
else {
review.setIsNeedReviewed(0);
}
review.setStatus(dto.getStatus());
review.setManagerId(dto.getUpdatedById());
review.setManagerName(dto.getUpdatedBy());
review.setManagerPhone(dto.getPhone());
review.setManagerCommitTime(new Date());
review.setUpdatedBy(dto.getUpdatedBy());
review.setUpdatedDate(new Date());
effectiveReferralReviewMapper.updateByPrimaryKeySelective(review);
......
......@@ -10,6 +10,7 @@ import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview;
import cn.com.glsx.dj.staff.service.staffPerformance.PerformanceTimeCycleService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
......@@ -97,8 +98,20 @@ public class EffectiveReferralReviewService {
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void effectiveReferralAudit(EffectiveReferralReviewCommonDTO dto) {
// 核心业务逻辑暂不实现
effectiveReferralReviewMapper.updateByPrimaryKeySelective(dto);
EffectiveReferralReview effectiveReferralReview = new EffectiveReferralReview();
Date curDate = new Date();
//将curDate 转化为 yyyy-MM
String format = DateUtil.format(curDate, "yyyy-MM");
effectiveReferralReview.setId(dto.getId());
effectiveReferralReview.setReviewedEffectiveCount(dto.getReviewedEffectiveCount());
effectiveReferralReview.setReviewMonth(format);
effectiveReferralReview.setIsReviewed(1);
effectiveReferralReview.setReviewedBy(dto.getUpdatedBy());
effectiveReferralReview.setReviewedName(dto.getUpdatedBy());
effectiveReferralReview.setReviewedTime(curDate);
effectiveReferralReview.setUpdatedBy(dto.getUpdatedBy());
effectiveReferralReview.setUpdatedDate(curDate);
effectiveReferralReviewMapper.updateByPrimaryKeySelective(effectiveReferralReview);
}
public String effectiveReferralExportData(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!