package com.fzzy.otherview.gd2022.pr; import com.alibaba.fastjson.JSONObject; import com.bstek.dorado.annotation.DataProvider; import com.fzzy.api.entity.ApiInfoData; import com.fzzy.api.service.ApiCommonService; import com.fzzy.api.service.ApiPushManager; import com.fzzy.api.view.repository.ApiInfoDataRep; import com.fzzy.otherview.gd2022.dto.GdApi1023; import com.fzzy.otherview.gd2022.dto.GdApi1023Dtl; import com.fzzy.otherview.gd2022.dto.GdApi1023People; import com.fzzy.otherview.gd2022.dto.GdApi1023Way; import com.fzzy.otherview.whhpjl.WhjlConstant; import com.fzzy.otherview.whhpjl.dto.WhjlApi1101; import com.fzzy.push.gd2022.ApiCodeConstant; import org.apache.commons.lang.time.DateFormatUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.*; /** * 广东省接口-1023 熏蒸备案 * * @author czt * @date 2023/8/17 */ @Component(value = "gDApi1023PR") public class GDApi1023PR { @Autowired private ApiCommonService apiCommonService; @Autowired private ApiPushManager apiPushManager; @Autowired private ApiInfoDataRep apiInfoDataRep; /** * 获取熏蒸备案主表信息 * gDApi1023PR#listData * * @return */ @DataProvider public List listData(Map param) { List result = apiInfoDataRep.getDataByInteId(ApiCodeConstant.API_1023); if(null == result ||result.isEmpty()){ return null; } List list = new ArrayList<>(); GdApi1023 gbApi1023; for (ApiInfoData infoData : result) { GdApi1023 gdApi1023= JSONObject.parseObject(infoData.getData(), GdApi1023.class); list.add(gdApi1023); } return list; } /** * 获取熏蒸作业人员信息表 * gDApi1023PR#peopleList * */ @DataProvider public List peopleList(Map param) throws Exception { String xzbm = (String) param.get("xzbm"); String deptId = (String) param.get("deptId"); String tbrq = DateFormatUtils.format((Date) param.get("tbrq"), "yyyyMMdd"); String id = xzbm + deptId + tbrq; List infoData = apiInfoDataRep.getDataByDataId(id); if(null == infoData || infoData.isEmpty()){ return null; } GdApi1023 gdApi1023= JSONObject.parseObject(infoData.get(0).getData(), GdApi1023.class); if(null == gdApi1023){ return null; } return gdApi1023.getPeoples(); } /** * 获取熏蒸备案方式表表信息 * gDApi1023PR#wayList * */ @DataProvider public List wayList(Map param) throws Exception { String xzbm = (String) param.get("xzbm"); String deptId = (String) param.get("deptId"); String tbrq = DateFormatUtils.format((Date) param.get("tbrq"), "yyyyMMdd"); String id = xzbm + deptId + tbrq; List infoData = apiInfoDataRep.getDataByDataId(id); if(null == infoData || infoData.isEmpty()){ return null; } GdApi1023 gdApi1023= JSONObject.parseObject(infoData.get(0).getData(), GdApi1023.class); if(null == gdApi1023){ return null; } return gdApi1023.getWays(); } /** * 实施熏蒸作业的储粮粮情明细表 * gDApi1023PR#dtlList * */ @DataProvider public List dtlList(Map param) throws Exception { String xzbm = (String) param.get("xzbm"); String deptId = (String) param.get("deptId"); String tbrq = DateFormatUtils.format((Date) param.get("tbrq"), "yyyyMMdd"); String id = xzbm + deptId + tbrq; List infoData = apiInfoDataRep.getDataByDataId(id); if(null == infoData || infoData.isEmpty()){ return null; } GdApi1023 gdApi1023= JSONObject.parseObject(infoData.get(0).getData(), GdApi1023.class); if(null == gdApi1023){ return null; } return gdApi1023.getDtls(); } }