package com.sw.mes.sap.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.google.gson.Gson;
import com.sw.mes.core.annotation.Jinko;
import com.sw.mes.core.annotation.ServiceLogs;
import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.core.dto.sap.ReportSapChargItemDto;
import com.sw.mes.core.dto.sap.ReportSapGoodsmvtDto;
import com.sw.mes.sap.dao.ReportSapGoodsmvtDao;
import com.sw.mes.sap.entity.RecycledReportSapRecord;
import com.sw.mes.sap.entity.ReportSapGoodsmvt;
import com.sw.mes.sap.service.RecycledReportSapRecordService;
import lombok.extern.slf4j.Slf4j;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * MES报工SAP的记录Service业务层处理
 */
@Slf4j
@Service
@Transactional
@Jinko(author = "yyl", value = "MES报工SAP的记录Service业务层处理")
public class RecycledReportSapRecordServiceImpl extends BaseServiceImpl<RecycledReportSapRecord> implements RecycledReportSapRecordService {
    private ReportSapGoodsmvtDao dao;

    @Autowired
    ModelMapper modelMapper;

    @Autowired
    public void setDao(ReportSapGoodsmvtDao dao) {
        super.setBaseDao(dao);
        this.dao = dao;
    }

    @Override
    @ServiceLogs(description = "1记录mes发送SAP的余料副产品收货")
    public void saveRecycledRecordRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }
    @Override
    @ServiceLogs(description = "2记录mes发送SAP的废料副产品收货")
    public void saveWasteRecordRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }
    @Override
    @ServiceLogs(description = "3记录mes发送SAP的余料副产品调拨")
    public void saveRecycledRecordAllotRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }
    @Override
    @ServiceLogs(description = "4记录mes发送SAP的废料副产品调拨(无此场景)")
    public void saveWasteRecordAllotRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }
    @Override
    @ServiceLogs(description = "5记录mes发送SAP的硅料清洗分选")
    public void saveCleanConsumeRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }
    @Override
    @ServiceLogs(description = "6记录mes发送SAP的硅料收货")
    public void saveCleanGroupRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }
    @Override
    @ServiceLogs(description = "7记录mes线边仓手动发送SAP的硅料成品调拨")
    public void saveCleanGroupAllotRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }
    @Override
    @ServiceLogs(description = "8记录mes线边仓手动发送SAP的刀剖余料副产品调拨")
    public void saveRecycledNoAutoAllotRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }
    @Override
    @ServiceLogs(description = "9记录mes线边仓手动发送SAP的截断余料副产品调拨")
    public void saveJdRecycledNoAutoAllotRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }

    @Override
    @ServiceLogs(description = "10记录mes线边仓手动创建并审核发送SAP的产品调拨")
    public void saveOtherRecycledNoAutoAllotRecord(RecycledReportSapRecord recycledReportSapRecord) {
        this.saveOrUpdate(recycledReportSapRecord);
    }
}
