Commit f99a1b35 by 王璐琦

fix(dailyreport): 解析请求JSON并调整日报查询逻辑

- 在保存日报及草稿接口中调用request.parseRequestJson()解析JSON请求参数
- 动态日报保存请求新增requestJson字段及解析方法parseRequestJson()
- 门店日报不按员工UUID过滤,实现门店级数据共享
- 删除日报列表请求中staffUuid参数的@NotNull注解
- 日报服务查询增加判断,门店日报忽略员工UUID条件,支持多条日期去重返回
- 统一整车延保成交价格字段命名为extendedWarrantyOrderMoney
- 商品订单服务TotalOrderMoney计算改为所有子项累加,替代之前的单一值赋值逻辑
1 parent 64c6ceee
...@@ -586,20 +586,23 @@ public class DailyReportRecordService { ...@@ -586,20 +586,23 @@ public class DailyReportRecordService {
RpcAssert.assertNotNull(dailyReportRecordDTO.getReportStartDate(), DefaultErrorEnum.DATA_NULL, "dailyReportRecordDTO.getReportStartDate() must not be null"); RpcAssert.assertNotNull(dailyReportRecordDTO.getReportStartDate(), DefaultErrorEnum.DATA_NULL, "dailyReportRecordDTO.getReportStartDate() must not be null");
RpcAssert.assertNotNull(dailyReportRecordDTO.getReportEndDate(), DefaultErrorEnum.DATA_NULL, "dailyReportRecordDTO.getReportEndDate() must not be null"); RpcAssert.assertNotNull(dailyReportRecordDTO.getReportEndDate(), DefaultErrorEnum.DATA_NULL, "dailyReportRecordDTO.getReportEndDate() must not be null");
RpcAssert.assertNotNull(dailyReportRecordDTO.getMerchantId(), DefaultErrorEnum.DATA_NULL, "dailyReportRecordDTO.getMerchantId must not be null"); RpcAssert.assertNotNull(dailyReportRecordDTO.getMerchantId(), DefaultErrorEnum.DATA_NULL, "dailyReportRecordDTO.getMerchantId must not be null");
RpcAssert.assertNotNull(dailyReportRecordDTO.getStaffUuid(), DefaultErrorEnum.DATA_NULL, "dailyReportRecordDTO.getStaffUuid must not be null"); RpcAssert.assertNotNull(dailyReportRecordDTO.getTemplateType(), DefaultErrorEnum.DATA_NULL, "dailyReportRecordDTO.getTemplateType must not be null");
try { try {
Example example = new Example(DailyReportRecord.class); Example example = new Example(DailyReportRecord.class);
example.createCriteria() Example.Criteria criteria = example.createCriteria()
.andEqualTo("deletedFlag", DeleteFlagEnum.N.getValue()) .andEqualTo("deletedFlag", DeleteFlagEnum.N.getValue())
.andEqualTo("merchantId", dailyReportRecordDTO.getMerchantId()) .andEqualTo("merchantId", dailyReportRecordDTO.getMerchantId())
.andEqualTo("staffUuid", dailyReportRecordDTO.getStaffUuid())
.andEqualTo("templateType", dailyReportRecordDTO.getTemplateType()) .andEqualTo("templateType", dailyReportRecordDTO.getTemplateType())
.andBetween("reportDate", dailyReportRecordDTO.getReportStartDate(), dailyReportRecordDTO.getReportEndDate()); .andBetween("reportDate", dailyReportRecordDTO.getReportStartDate(), dailyReportRecordDTO.getReportEndDate());
// 门店日报不按个人维度过滤
if (!Objects.equals(DailyReportTemplateTypeEnum.MERCHANT_DAILY_REPORT.getValue(), dailyReportRecordDTO.getTemplateType())) {
criteria.andEqualTo("staffUuid", dailyReportRecordDTO.getStaffUuid());
}
List<DailyReportRecord> records = dailyReportRecordMapper.selectByExample(example); List<DailyReportRecord> records = dailyReportRecordMapper.selectByExample(example);
if (CollectionUtils.isEmpty(records)) { if (CollectionUtils.isEmpty(records)) {
return Lists.newArrayList(); return Lists.newArrayList();
} }
return records.stream().map(DailyReportRecord::getReportDate).collect(Collectors.toList()); return records.stream().map(DailyReportRecord::getReportDate).distinct().collect(Collectors.toList());
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
log.info(e.getMessage(), e); log.info(e.getMessage(), e);
throw e; throw e;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!