|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<Api9201> api9201List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Api1105 api1105; | 
|---|
|  |  |  | Api9201 api9201; | 
|---|
|  |  |  | Gd2022Api1023Dtl api9201Dtl; | 
|---|
|  |  |  | Gd2022Api1023Way api9201Way; | 
|---|
|  |  |  | 
|---|
|  |  |  | if (null != api1101List && api1101List.size() > 0) { | 
|---|
|  |  |  | api9201.setDwmc(api1101List.get(0).getDwmc()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | api9201.setYjmc(data.getDrugName()); | 
|---|
|  |  |  | api9201.setYjlx(data.getDrugType()); | 
|---|
|  |  |  | api9201.setYjmc(data.getDrugName().trim()); | 
|---|
|  |  |  | api9201.setYjlx(data.getDrugType().trim()); | 
|---|
|  |  |  | api9201.setLqrq(data.getLqsj()); | 
|---|
|  |  |  | api9201.setZhgxsj(data.getUpdateTime()); | 
|---|
|  |  |  | api9201.setXcfzr(data.getXcfzr().trim()); | 
|---|
|  |  |  | if (data.getLqr().contains("、")) { | 
|---|
|  |  |  | api9201.setLqr(data.getLqr().replace('、', '|')); | 
|---|
|  |  |  | api9201.setLqr(data.getLqr().replace('、', '|').trim()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //储粮粮情明细表 | 
|---|
|  |  |  | List<Fz40DrugLogDtl> dtls = drugLogDtlRep.listDrugLogDtl(data.getXzbm()); | 
|---|
|  |  |  | Api1105 api1105 = commonService.getApi1105Cache(data.getDepotId()); | 
|---|
|  |  |  | api9201Dtl = new Gd2022Api1023Dtl(); | 
|---|
|  |  |  | BeanUtils.copyProperties(data, api9201Dtl); | 
|---|
|  |  |  | if (null != api1105) { | 
|---|
|  |  |  | api9201Dtl.setCfmc(api1105.getHwmc()); | 
|---|
|  |  |  | api9201Dtl.setCfdm(api1105.getHwdm().substring(0, 25)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null != dtls && dtls.size() > 0) { | 
|---|
|  |  |  | dtlList = new ArrayList<>(); | 
|---|
|  |  |  | for (Fz40DrugLogDtl dtl : dtls) { | 
|---|
|  |  |  | api9201Dtl = new Gd2022Api1023Dtl(); | 
|---|
|  |  |  | BeanUtils.copyProperties(dtl, api9201Dtl); | 
|---|
|  |  |  | api1105 = commonService.getApi1105Cache(dtl.getDepotId()); | 
|---|
|  |  |  | if (null != api1105) { | 
|---|
|  |  |  | api9201Dtl.setCfmc(api1105.getHwmc()); | 
|---|
|  |  |  | api9201Dtl.setCfdm(api1105.getHwdm().substring(0, 25)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //粮食品种 | 
|---|
|  |  |  | String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, dtl.getFoodVariety()); | 
|---|
|  |  |  | api9201Dtl.setLspzdm(mappingCode); | 
|---|
|  |  |  | mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, dtl.getFoodType()); | 
|---|
|  |  |  | api9201Dtl.setLsxzdm(mappingCode); | 
|---|
|  |  |  | api9201Dtl.setLsdjdm(dtl.getFoodLevel()); | 
|---|
|  |  |  | api9201Dtl.setLssl(dtl.getNumber()); | 
|---|
|  |  |  | api9201Dtl.setSf(dtl.getPerWet()); | 
|---|
|  |  |  | api9201Dtl.setZz(dtl.getPerImpurity()); | 
|---|
|  |  |  | dtlList.add(api9201Dtl); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | api9201.setDtl(JSON.toJSONString(dtlList)); | 
|---|
|  |  |  | api9201List = api9201Rep.getDataByBizId(api9201.getBizId()); | 
|---|
|  |  |  | if (null == api9201List || api9201List.isEmpty()) { | 
|---|
|  |  |  | api9201.setCzbz(Constant.CZBZ_I); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | api9201.setCzbz(api9201List.get(0).getCzbz()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //粮食品种 | 
|---|
|  |  |  | String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, data.getFoodVariety()); | 
|---|
|  |  |  | api9201Dtl.setLspzdm(mappingCode); | 
|---|
|  |  |  | api9201Dtl.setLsxzdm(data.getFoodType()); | 
|---|
|  |  |  | api9201Dtl.setLsdjdm(data.getFoodLevel()); | 
|---|
|  |  |  | api9201Dtl.setLssl(data.getNumber()); | 
|---|
|  |  |  | api9201Dtl.setSf(data.getPerWet()); | 
|---|
|  |  |  | api9201Dtl.setZz(data.getPerImpurity()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | dtlList = new ArrayList<>(); | 
|---|
|  |  |  | dtlList.add(api9201Dtl); | 
|---|
|  |  |  | api9201.setDtl(JSON.toJSONString(dtlList)); | 
|---|
|  |  |  | //                BeanUtils.copyProperties(data, api9201Dtl); | 
|---|
|  |  |  | //                dtlList = new ArrayList<>(); | 
|---|
|  |  |  | //                dtlList.add(api9201Dtl); | 
|---|
|  |  |  | //                api9201.setDtl(JSON.toJSONString(dtlList)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | api9201Way = new Gd2022Api1023Way(); | 
|---|
|  |  |  | BeanUtils.copyProperties(data, api9201Way); | 
|---|
|  |  |  | wayList = new ArrayList<>(); | 
|---|
|  |  |  | api9201Way.setSqfs(data.getSqfs().trim()); | 
|---|
|  |  |  | api9201Way.setXzfs(data.getXzfs().trim()); | 
|---|
|  |  |  | wayList.add(api9201Way); | 
|---|
|  |  |  | api9201.setWay(JSON.toJSONString(wayList)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | for (Fz40DrugLogPeople people : peoples) { | 
|---|
|  |  |  | api9201People = new Gd2022Api1023People(); | 
|---|
|  |  |  | BeanUtils.copyProperties(people, api9201People); | 
|---|
|  |  |  | api9201People.setXm(people.getMx()); | 
|---|
|  |  |  | api9201People.setXm(people.getMx().trim()); | 
|---|
|  |  |  | api9201People.setZw(people.getZw().trim()); | 
|---|
|  |  |  | api9201People.setXzrwfg(people.getXzrwfg().trim()); | 
|---|
|  |  |  | api9201People.setStzk(people.getStzk().trim()); | 
|---|
|  |  |  | if (StringUtils.isEmpty(people.getZyzg())) { | 
|---|
|  |  |  | api9201People.setZyzg("培训合格"); | 
|---|
|  |  |  | people.setZyzg("培训合格"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (StringUtils.isEmpty(people.getSfwb())) { | 
|---|
|  |  |  | people.setSfwb("否"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | api9201People.setZyzg(people.getZyzg().trim()); | 
|---|
|  |  |  | peopleList.add(api9201People); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | api9201.setPeople(JSON.toJSONString(peopleList)); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("---熏蒸备案同步执行失败----{}", e.toString()); | 
|---|
|  |  |  | log.error("---熏蒸备案同步执行失败----{}", e); | 
|---|
|  |  |  | apiLog.setResult("熏蒸备案信息同步执行失败:" + e.getMessage()); | 
|---|
|  |  |  | apiLogRep.save(apiLog); | 
|---|
|  |  |  | } | 
|---|