Commit 79b6922d by 崔彦峰

modify:列表查询。

1 parent 84a28b3e
......@@ -16,4 +16,8 @@ public class StoreEffectiveReferralDetailDTO implements Serializable {
@ApiModelProperty(value = "业务场景引荐数列表")
private List<SceneTypeEffectiveReferralDTO> sceneTypeEffectiveReferrals;
@ApiModelProperty(notes = "是否可编辑:0-不可编辑,1-可编辑")
private Integer updateFlag;
}
......@@ -3,10 +3,13 @@ package cn.com.glsx.dj.staff.service.perfSalary;
import cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO;
import cn.com.glsx.dj.smartcarlife.response.ServiceStaffRopResponse;
import cn.com.glsx.dj.staff.dto.perfSalary.*;
import cn.com.glsx.dj.staff.dto.performance.PerformanceTimeCycleDTO;
import cn.com.glsx.dj.staff.enums.PerformanceTimeCycleCodeEnum;
import cn.com.glsx.dj.staff.enums.perfSalary.EffectiveReferralBrandTypeEnum;
import cn.com.glsx.dj.staff.enums.perfSalary.EffectiveReferralSceneEnum;
import cn.com.glsx.dj.staff.mapper.perfSalary.EffectiveReferralReviewMapper;
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.BaseModel;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
......@@ -50,6 +53,9 @@ public class EffectiveReferralReviewMiniProgramService {
@Autowired
private TaskExecutor taskExecutor;
@Resource
private PerformanceTimeCycleService performanceTimeCycleService;
public List<EffectiveReferralReviewCommonDTO> effectiveReferralStoreList(EffectiveReferralReviewCommonDTO request) {
//筛选项:门店名字(模糊搜索),状态:未提交、已提交,月份:2026-01,
//特殊逻辑:根据商户门店id去重,根据门店首字母倒序。要根据门店的不同业务场景的数据判断是否已提交和未提交。
......@@ -102,25 +108,53 @@ public class EffectiveReferralReviewMiniProgramService {
}
//2、查询其它品牌名称
String otherBrandName = "";
List<EffectiveReferralReviewCommonDTO> otherBrandEffectiveReferrals =
referralReviewCommonDTOS.stream().filter(item -> item.getBrandId() == -1).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(otherBrandEffectiveReferrals)) {
Map<Integer, String> merchantBandInfoMap = this.batchQueryMerchantBandInfo(Lists.newArrayList(merchantId));
otherBrandName = this.filterDistinctBrandName(merchantBandInfoMap.get(merchantId), "鸿蒙智行");
}
String otherBrandName = getOtherBrandName(merchantId, referralReviewCommonDTOS);
//3、封装各业务场景引荐数
List<SceneTypeEffectiveReferralDTO> sceneTypeEffectiveReferrals = getSceneTypeEffectiveReferralDTOS(referralReviewCommonDTOS, otherBrandName);
//4、封装返回参数
//4、获取是否可编辑标识
PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode());
//5、封装返回参数
StoreEffectiveReferralDetailDTO detailDTO = new StoreEffectiveReferralDetailDTO();
if (Objects.nonNull(performanceTimeCycleDTO)
&& performanceTimeCycleDTO.getStartDate() != null
&& performanceTimeCycleDTO.getEndDate() != null
&& new Date().after(performanceTimeCycleDTO.getEndDate())) {
detailDTO.setUpdateFlag(0);
}
else {
detailDTO.setUpdateFlag(1);
}
detailDTO.setMerchantName(referralReviewCommonDTOS.get(0).getMerchantName());
detailDTO.setSceneTypeEffectiveReferrals(sceneTypeEffectiveReferrals);
return detailDTO;
}
/**
* 获取门店其它品牌名称
*
* @param merchantId
* @param referralReviewCommonDTOS
* @return
*/
private String getOtherBrandName(Integer merchantId, List<EffectiveReferralReviewCommonDTO> referralReviewCommonDTOS) {
String otherBrandName = "";
try {
List<EffectiveReferralReviewCommonDTO> otherBrandEffectiveReferrals =
referralReviewCommonDTOS.stream().filter(item -> item.getBrandId() == -1).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(otherBrandEffectiveReferrals)) {
Map<Integer, String> merchantBandInfoMap = this.batchQueryMerchantBandInfo(Lists.newArrayList(merchantId));
otherBrandName = this.filterDistinctBrandName(merchantBandInfoMap.get(merchantId), "鸿蒙智行");
}
} catch (Exception e) {
log.info("获取门店其它品牌名称异常,merchantId:{}", merchantId, e);
}
return otherBrandName;
}
/**
* 根据业务场景获取各业务场景引荐数
*
* @param referralReviewCommonDTOS
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!