| | |
| | | |
| | | if(POINT_CHANGE_TYPE.add.name().equals(detail.getChangeType())){ |
| | | point.setTotalPoint(point.getTotalPoint() + detail.getPoint()); |
| | | point.setUsedPoint(point.getUsedPoint() + detail.getUsePoint()); |
| | | point.setExpiredPoint(point.getExpiredPoint() + detail.getExpiredPoint()); |
| | | }else if(POINT_CHANGE_TYPE.reduce.name().equals(detail.getChangeType())){ |
| | | // if(point.getTotalPoint()!= null && point.getTotalPoint()!=0 && point.getTotalPoint()>= detail.getPoint()){ |
| | | // point.setTotalPoint(point.getTotalPoint() - detail.getPoint()); |
| | | // }else{ |
| | | // //积分不足,直接清0 |
| | | // point.setTotalPoint(0); |
| | | // } |
| | | if(point.getTotalPoint()!= null && point.getTotalPoint()!=0 && point.getTotalPoint()>= detail.getPoint()){ |
| | | point.setTotalPoint(point.getTotalPoint() - detail.getPoint()); |
| | | }else{ |
| | | //积分不足,直接清0 |
| | | point.setTotalPoint(0); |
| | | detail.setPoint(point.getTotalPoint()); |
| | | detail.setRemarks(detail.getRemarks()+",积分不足,扣除剩余积分"+point.getTotalPoint()); |
| | | } |
| | | } |
| | | if(isAdd){ |
| | | customerPointMapper.insert(point); |
| | |
| | | detail.setChangeType(POINT_CHANGE_TYPE.reduce.name()); |
| | | detail.setType(POINT_TYPE.deduction.name()); |
| | | detail.create(SecurityUtils.getUserId()); |
| | | customerPointDetailMapper.insert(detail); |
| | | |
| | | //更新汇总表 |
| | | updateCustomerPoint(detail); |
| | | |
| | | customerPointDetailMapper.insert(detail); |
| | | } |
| | | |
| | | public void consumptionPoint(BigDecimal orderAmount, String orderNo,String userId) { |