package com.tofly.third.service;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tofly.third.entity.ZnbHdLog;
import com.tofly.third.entity.ZnbZlLog;
import com.tofly.third.mapper.ZnbHdLogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Slf4j
@Service
public class ZnbHdLogService extends ServiceImpl<ZnbHdLogMapper, ZnbHdLog> {

    public void hdzl(ZnbZlLog zlLog) {
        ZnbHdLog znbHdLog = new ZnbHdLog();
        znbHdLog.setYhbh(zlLog.getYhbh())
                .setCbkh(zlLog.getCbkh())
                .setCbkid(zlLog.getCbkid())
                .setBjbh(zlLog.getBjbh())
                .setSccj(zlLog.getSccj())
                .setSsgs(zlLog.getSsgs())
                .setPch(zlLog.getPch())
                .setCzry(zlLog.getCzry())
                .setCzsj(zlLog.getCzsj())
                .setClLock(zlLog.getClLock())
                .setClCljg(zlLog.getClCljg())
                .setClClry(zlLog.getClClry())
                .setClClsj(LocalDateTime.now())
                .setClRecode(zlLog.getClRecode())
                .setClRemessage(zlLog.getClRemessage())
                .setYwlx(3)
                .setGmcs(0)
                .setSyje(BigDecimal.ZERO)
                .setZlId(zlLog.getId());
        save(znbHdLog);
    }

}
