parent
3be28f5226
commit
d9afec0a59
@ -0,0 +1,24 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.entity.BsOrderSettle; |
||||
|
||||
/** |
||||
* @className: BsOrderSettleService |
||||
* @author: HuRui |
||||
* @date: 2024/6/24 |
||||
**/ |
||||
public interface BsOrderSettleService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param data |
||||
*/ |
||||
void editData(BsOrderSettle data); |
||||
|
||||
/** |
||||
* 查询数据 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
BsOrderSettle getData(String orderNo); |
||||
} |
@ -0,0 +1,41 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.entity.BsGasOrder; |
||||
import com.hfkj.entity.BsOrderChild; |
||||
import com.hfkj.entity.BsOrderRefund; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.service.gas.BsGasOrderService; |
||||
import com.hfkj.sysenum.gas.OrderOilStatus; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
/** |
||||
* 退款业务 |
||||
* @className: OrderRefundService |
||||
* @author: HuRui |
||||
* @date: 2024/6/24 |
||||
**/ |
||||
@Component |
||||
public class OrderRefundBusiness { |
||||
|
||||
@Resource |
||||
private BsGasOrderService gasOrderService; |
||||
|
||||
/** |
||||
* 加油订单业务 |
||||
* @param refund |
||||
*/ |
||||
public void gasOrder(BsOrderRefund refund) { |
||||
// 查询加油订单
|
||||
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(refund.getOrderNo()); |
||||
if (gasOrder != null) { |
||||
gasOrder.setStatus(OrderOilStatus.STATUS4.getNumber()); |
||||
gasOrder.setRefundTime(refund.getFinishTime()); |
||||
gasOrder.setRefundRemarks(refund.getRefundRemark()); |
||||
gasOrderService.updateGasOrder(gasOrder); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,44 @@ |
||||
package com.hfkj.service.order.impl; |
||||
|
||||
import com.hfkj.dao.BsOrderSettleMapper; |
||||
import com.hfkj.entity.BsOrderSettle; |
||||
import com.hfkj.entity.BsOrderSettleExample; |
||||
import com.hfkj.service.order.BsOrderSettleService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsOrderSettleServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/6/24 |
||||
**/ |
||||
@Service("BsOrderSettleService") |
||||
public class BsOrderSettleServiceImpl implements BsOrderSettleService { |
||||
@Resource |
||||
private BsOrderSettleMapper orderSettleMapper; |
||||
|
||||
@Override |
||||
public void editData(BsOrderSettle data) { |
||||
data.setUpdateTime(new Date()); |
||||
if (data.getId() == null) { |
||||
data.setCreateTime(new Date()); |
||||
orderSettleMapper.insert(data); |
||||
} else { |
||||
orderSettleMapper.updateByPrimaryKey(data); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderSettle getData(String orderNo) { |
||||
BsOrderSettleExample example = new BsOrderSettleExample(); |
||||
example.createCriteria().andOrderNoEqualTo(orderNo); |
||||
List<BsOrderSettle> list = orderSettleMapper.selectByExample(example); |
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
} |
Loading…
Reference in new issue