package com.yeejoin.amos.boot.module.ugp.biz.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.Enum.IntelligentInspectionEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.InspectionDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Inspection;
import com.yeejoin.amos.boot.module.ugp.api.mapper.InspectionMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;

@Service
public class InspectionServiceImpl extends BaseService<InspectionDto, Inspection, InspectionMapper> {

    public String saveInfo(JSONObject jsonObject) {
        Inspection inspection = new Inspection();
        inspection.setProjectId(Long.valueOf(jsonObject.getString("projectId")));
        inspection.setCode(jsonObject.getString("code"));
        inspection.setStatus(IntelligentInspectionEnum.getStatusByNameMap.get(jsonObject.getString("status")));
        inspection.setImage(jsonObject.getString("image"));
        this.save(inspection);
        return "ok";
    }

}
