Browse Source

退款逻辑

milestone-20250702-金币重构一期
sunjiabei 9 hours ago
parent
commit
5206832e34
  1. 3
      src/main/java/com/example/demo/serviceImpl/RefundServiceImpl.java
  2. 6
      src/main/resources/mapper/ConsumeMapper.xml

3
src/main/java/com/example/demo/serviceImpl/RefundServiceImpl.java

@ -13,6 +13,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
@ -87,7 +88,7 @@ public class RefundServiceImpl implements RefundService {
List<RefundUser> refundUsers = refundMapper.selectBy(refundUser);
return new PageInfo<>(refundUsers);
}
@Transactional
@Override
public Result add(RefundUser refundUser) {
UserGoldRecord userGoldRecord = new UserGoldRecord();

6
src/main/resources/mapper/ConsumeMapper.xml

@ -175,11 +175,7 @@
<update id="updateIsRefund" parameterType="java.lang.String">
UPDATE user_gold_record
SET is_refund = 1
<where>
where
order_code = #{orderCode}
<if test="isRefund != null and isRefund != 0">
AND is_refund != 0 <!-- 可选:仅更新非0状态的记录 -->
</if>
</where>
</update>
</mapper>
Loading…
Cancel
Save