package com.xhpc.activity.service.impl;

import com.xhpc.activity.mapper.XhpcDeviceMessageMapper;
import com.xhpc.activity.service.IXhpcDeviceMessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author yuyang
 * @Date 2025-09-17 14:45
 */
@Service
public class XhpcDeviceMessageServiceImpl implements IXhpcDeviceMessageService {

    @Resource
    XhpcDeviceMessageMapper xhpcDeviceMessageMapper;


    @Override
    public void addXhpcDeviceMessage() {
        //查询当前已结算的占位费订单

        String serialNumber = xhpcDeviceMessageMapper.getXhpcPlaceholderOrder();

        if(serialNumber !=null && !"".equals(serialNumber)){
            xhpcDeviceMessageMapper.addXhpcDeviceMessage(serialNumber);

            xhpcDeviceMessageMapper.addXhpcDeviceMessageGunStatus(serialNumber,serialNumber.substring(0,16));

            xhpcDeviceMessageMapper.updateXhpcPlaceholderOrder(serialNumber);
        }


    }


    public static void main(String[] args) {
        System.out.println("80836000050013012509161214298944".substring(0,16));
    }
}
