Commit f7156f0e authored by hongguangwu's avatar hongguangwu

收入优化

parent 92720647
...@@ -33,4 +33,12 @@ import java.util.List; ...@@ -33,4 +33,12 @@ import java.util.List;
@Mapper @Mapper
public interface TIncomeDetailMapper extends BaseMapper<TIncomeDetail> { public interface TIncomeDetailMapper extends BaseMapper<TIncomeDetail> {
List<TIncomeDetail> getTIncomeDetailList(@Param("tIncomeDetail") TIncomeDetail tIncomeDetail); List<TIncomeDetail> getTIncomeDetailList(@Param("tIncomeDetail") TIncomeDetail tIncomeDetail);
/**
* @Description: 获取重复性
* @Author: hgw
* @Date: 2022/12/5 11:16
* @return: int
**/
int getTIncomeDetailRepeat(@Param("tIncomeDetail") TIncomeDetail detail);
} }
...@@ -30,4 +30,13 @@ import java.util.List; ...@@ -30,4 +30,13 @@ import java.util.List;
*/ */
public interface TIncomeDetailService extends IService<TIncomeDetail> { public interface TIncomeDetailService extends IService<TIncomeDetail> {
List<TIncomeDetail> getTIncomeDetailList(TIncomeDetail detail); List<TIncomeDetail> getTIncomeDetailList(TIncomeDetail detail);
/**
* @Description: 获取重复性
* @Author: hgw
* @Date: 2022/12/5 11:16
* @return: int
**/
int getTIncomeDetailRepeat(TIncomeDetail detail);
} }
...@@ -39,4 +39,15 @@ public class TIncomeDetailServiceImpl extends ServiceImpl<TIncomeDetailMapper, T ...@@ -39,4 +39,15 @@ public class TIncomeDetailServiceImpl extends ServiceImpl<TIncomeDetailMapper, T
public List<TIncomeDetail> getTIncomeDetailList(TIncomeDetail detail) { public List<TIncomeDetail> getTIncomeDetailList(TIncomeDetail detail) {
return baseMapper.getTIncomeDetailList(detail); return baseMapper.getTIncomeDetailList(detail);
} }
/**
* @Description: 获取重复性
* @Author: hgw
* @Date: 2022/12/5 11:16
* @return: int
**/
@Override
public int getTIncomeDetailRepeat(TIncomeDetail detail) {
return baseMapper.getTIncomeDetailRepeat(detail);
}
} }
...@@ -578,12 +578,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -578,12 +578,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if (Common.isNotNull(tIncomeDetail.getSourceId())) { if (Common.isNotNull(tIncomeDetail.getSourceId())) {
// 如果该id、该类型的金额已存在,则不允许重复生成推送 // 如果该id、该类型的金额已存在,则不允许重复生成推送
TIncomeDetail a = new TIncomeDetail(); TIncomeDetail a = new TIncomeDetail();
a.setId(tIncomeDetail.getId());
a.setSourceId(tIncomeDetail.getSourceId()); a.setSourceId(tIncomeDetail.getSourceId());
a.setMoney(tIncomeDetail.getMoney()); a.setMoney(tIncomeDetail.getMoney());
a.setRedData(tIncomeDetail.getRedData()); a.setRedData(tIncomeDetail.getRedData());
a.setFeeType(tIncomeDetail.getFeeType()); a.setFeeType(tIncomeDetail.getFeeType());
List<TIncomeDetail> aList = tIncomeDetailService.getTIncomeDetailList(a); int repeatNums = tIncomeDetailService.getTIncomeDetailRepeat(a);
if (aList != null && !aList.isEmpty()) { if (repeatNums > CommonConstants.ZERO_INT) {
return true; return true;
} }
} }
......
...@@ -156,4 +156,16 @@ ...@@ -156,4 +156,16 @@
</where> </where>
</select> </select>
<!-- 获取重复性 -->
<select id="getTIncomeDetailRepeat" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_income_detail a
where a.ID != #{tIncomeDetail.id}
AND a.SOURCE_ID = #{tIncomeDetail.sourceId}
AND a.MONEY = #{tIncomeDetail.money}
AND a.RED_DATA = #{tIncomeDetail.redData}
AND a.FEE_TYPE = #{tIncomeDetail.feeType}
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment