0deb1cb3 刘嘉

增加查询还有哪些订单 整单是售后完成,但订单状态不是[退款/退货成功]状态的:判断是否全额退款逻辑修改

1 个父辈 5181991b
......@@ -351,7 +351,7 @@ refund_id,
</select>
<select id="countRefundOrderListByOrderCode" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT COUNT(*) FROM im_refund_order_item r1,im_order_refund r WHERE r1.refund_id = r.refund_id
SELECT sum(r1.quantity) FROM im_refund_order_item r1,im_order_refund r WHERE r1.refund_id = r.refund_id
AND r.refund_status = 7 AND r.order_code = #{orderCode}
</select>
</mapper>
\ No newline at end of file
......
......@@ -12,6 +12,8 @@ public class RefundUnsuccessfulBean {
private Integer orderStatus;
private String status;
private Integer refundNum;
private Integer order1Num;
......
......@@ -803,11 +803,15 @@ public class IMRefundOrderService extends BaseServiceImpl implements IIMRefundOr
|| doingOrderDetailResponse.getOrderStatus() == PayOrderStatus.RefundFail.getCode()
|| doingOrderDetailResponse.getOrderStatus() == PayOrderStatus.Finished.getCode())){
Integer refundNum = imRefundOrderDao.countRefundOrderListByOrderCode(doingOrderDetailResponse.getOrderCode());
if(refundNum.intValue() == doingOrderDetailResponse.getOrder1s().size()){
Integer order1Num = doingOrderDetailResponse.getOrder1s().stream().map(p -> p.getPurchaseQuantity()).reduce(0,(a,b) ->{
return a+b;
});
if(refundNum.intValue() == order1Num){
RefundUnsuccessfulBean entity = new RefundUnsuccessfulBean();
entity.setOrder1Num(doingOrderDetailResponse.getOrder1s().size());
entity.setOrder1Num(order1Num);
entity.setOrderCode(doingOrderDetailResponse.getOrderCode());
entity.setOrderStatus(doingOrderDetailResponse.getOrderStatus());
entity.setStatus(doingOrderDetailResponse.getStatus());
entity.setRefundNum(refundNum.intValue());
refundUnsuccessfulBeanList.add(entity);
}
......