提交 7d6e1789 authored 作者: aiqingguo's avatar aiqingguo

修改dao返回值

上级 2c81e2d2
...@@ -23,7 +23,7 @@ public interface IntegralRecordDao extends BaseDao<IntegraRecordMapper, Integral ...@@ -23,7 +23,7 @@ public interface IntegralRecordDao extends BaseDao<IntegraRecordMapper, Integral
Integer sumIntegral(@Param("statisticsId") Integer statisticsId); Integer sumIntegral(@Param("statisticsId") Integer statisticsId);
IntegralRecord selectByStatisticsIdAndType(@Param("statisticsId") Integer statisticsId, @Param("type") Integer type); IntegralRecord selectByStatisticsIdAndType(@Param("statisticsId") Integer statisticsId, @Param("type") Integer type);
int sumByStatisticsIdAndTypes(@Param("statisticsId") Integer statisticsId, @Param("list") List<Integer> typeList); Integer sumByStatisticsIdAndTypes(@Param("statisticsId") Integer statisticsId, @Param("list") List<Integer> typeList);
Integer sumByStatisticsIdAndTypeAndTime(@Param("statisticsId") Integer statisticsId, Integer sumByStatisticsIdAndTypeAndTime(@Param("statisticsId") Integer statisticsId,
@Param("type") Integer type, @Param("type") Integer type,
......
...@@ -45,7 +45,7 @@ public class IntegralRecordDaoImpl extends BaseDaoImpl<IntegraRecordMapper, Inte ...@@ -45,7 +45,7 @@ public class IntegralRecordDaoImpl extends BaseDaoImpl<IntegraRecordMapper, Inte
} }
@Override @Override
public int sumByStatisticsIdAndTypes(Integer statisticsId, List<Integer> typeList) { public Integer sumByStatisticsIdAndTypes(Integer statisticsId, List<Integer> typeList) {
return baseMapper.sumByStatisticsIdAndTypes(statisticsId, typeList); return baseMapper.sumByStatisticsIdAndTypes(statisticsId, typeList);
} }
......
...@@ -40,7 +40,7 @@ public interface IntegraRecordMapper extends BaseMapper<IntegralRecord> { ...@@ -40,7 +40,7 @@ public interface IntegraRecordMapper extends BaseMapper<IntegralRecord> {
" type in <foreach collection='list' item='item' open='(' separator=',' close=')'>#{item}</foreach> " + " type in <foreach collection='list' item='item' open='(' separator=',' close=')'>#{item}</foreach> " +
" and statistics_id = #{statisticsId}" + " and statistics_id = #{statisticsId}" +
"</script>") "</script>")
int sumByStatisticsIdAndTypes(@Param("statisticsId") Integer statisticsId, @Param("list") List<Integer> typeList); Integer sumByStatisticsIdAndTypes(@Param("statisticsId") Integer statisticsId, @Param("list") List<Integer> typeList);
@Select("select count(1) from integral_record where statistics_id = #{statisticsId} and type = #{type} and create_time >= #{beginTime} and create_time < #{endTime}") @Select("select count(1) from integral_record where statistics_id = #{statisticsId} and type = #{type} and create_time >= #{beginTime} and create_time < #{endTime}")
Integer countByStatisticsIdAndTypeAndTime(@Param("statisticsId") Integer statisticsId, Integer countByStatisticsIdAndTypeAndTime(@Param("statisticsId") Integer statisticsId,
......
...@@ -571,7 +571,8 @@ public class IntegralMqHandlerServiceImpl implements IntegralMqHandlerService { ...@@ -571,7 +571,8 @@ public class IntegralMqHandlerServiceImpl implements IntegralMqHandlerService {
// 运单取消积分 // 运单取消积分
Integer cancelIntegral = ruleInfo.getPlatformCompensationRule().getIntegralCancel(); Integer cancelIntegral = ruleInfo.getPlatformCompensationRule().getIntegralCancel();
int sum = integralRecordDao.sumByStatisticsIdAndTypes(statistics.getId(), Arrays.asList(IntegralRecordEnum.Type.ORDER_CHILD_PLATFORM_CANCEL.getValue())); Integer sum = integralRecordDao.sumByStatisticsIdAndTypes(statistics.getId(), Arrays.asList(IntegralRecordEnum.Type.ORDER_CHILD_PLATFORM_CANCEL.getValue()));
if (sum == null) {sum = 0;}
if (sum > ruleInfo.getPlatformCompensationRule().getIntegralCancelLimit()){ if (sum > ruleInfo.getPlatformCompensationRule().getIntegralCancelLimit()){
log.info("达到当日平台补偿积分上限,本次无效, childNo:{}", orderChild.getChildNo()); log.info("达到当日平台补偿积分上限,本次无效, childNo:{}", orderChild.getChildNo());
return integralSum; return integralSum;
......
...@@ -78,7 +78,8 @@ public class IntegralRecordServiceImpl implements IntegralRecordService { ...@@ -78,7 +78,8 @@ public class IntegralRecordServiceImpl implements IntegralRecordService {
return; return;
} }
int sum = integralRecordDao.sumByStatisticsIdAndTypes(statistics.getId(), IntegralRecordEnum.DRIVER_REPORT_lIST); Integer sum = integralRecordDao.sumByStatisticsIdAndTypes(statistics.getId(), IntegralRecordEnum.DRIVER_REPORT_lIST);
if (sum == null) {sum = 0;}
if (sum > ruleInfo.getDriverReportRule().getIntegralLimit()){ if (sum > ruleInfo.getDriverReportRule().getIntegralLimit()){
log.info("上报积分超上限,本次无效, truckNo:{}, type:{}, integral:{}, remark:{}", truckNo, type, integral, remark); log.info("上报积分超上限,本次无效, truckNo:{}, type:{}, integral:{}, remark:{}", truckNo, type, integral, remark);
return; return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论