package com.steering.jobface.jhy.CollectionType;

import CoreFS.SA06.CoreReturnSortObject;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 硬度试验类
 * Created by 朱少波 on 2018/3/14.
 */
public class HardnessCollection extends BaseCollection {

    @Override
    public String[] GetPhyCodeMin() {
        return new String[]{"R0003","R0004","R0005","R0018"};
    }

    @Override
    public List<Map<String, Object>> GetCollectionData() {
        List<Map<String, Object>> data1 =  ( (CoreReturnSortObject) getDataBySqlID("PhyCollectDao","HardnessCollection.getData1").getResult() ).getResult();
        List<Map<String, Object>> data2 =  ( (CoreReturnSortObject) getDataBySqlID("PhyCollectDao","HardnessCollection.getData2").getResult() ).getResult();
         data1.addAll(data2);
        return data1;
    }

    @Override
    public void RemarkOldData(String CheckNo, String SampleNo) {
        ArrayList<String> ar = new ArrayList<String>();
        ar.add("HardnessCollection.setDataFlag1");
        ar.add("HardnessCollection.setDataFlag2");
        ArrayList<Object[]> para = new ArrayList<Object[]>();
        para.add(new Object[]{
                "3",
                CheckNo,SampleNo
        });
        para.add(new Object[]{
                "3",
                CheckNo,SampleNo
        });
        setDataById("PhyCollectDao",ar  ,para );
    }

    @Override
    public void RemarkFailData(String CheckNo, String SampleNo) {
        ArrayList<String> ar = new ArrayList<String>();
        ar.add("HardnessCollection.setDataFlag1");
        ar.add("HardnessCollection.setDataFlag2");
        ArrayList<Object[]> para = new ArrayList<Object[]>();
        para.add(new Object[]{
                "4",
                CheckNo,SampleNo
        });
        para.add(new Object[]{
                "4",
                CheckNo,SampleNo
        });
        setDataById("PhyCollectDao",ar  ,para );
    }

    @Override
    public void RemarkOkData(String CheckNo, String SampleNo) {
        ArrayList<String> ar = new ArrayList<String>();
        ar.add("HardnessCollection.setDataFlag1");
        ar.add("HardnessCollection.setDataFlag2");
        ArrayList<Object[]> para = new ArrayList<Object[]>();
        para.add(new Object[]{
                "1",
                CheckNo,SampleNo
        });
        para.add(new Object[]{
                "1",
                CheckNo,SampleNo
        });
        setDataById("PhyCollectDao",ar  ,para );
    }
}
