|  |  |  | 
|---|
|  |  |  | package com.fzzy.async.fzzy40.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.fzzy.api.Constant; | 
|---|
|  |  |  | import com.fzzy.api.entity.Api1105; | 
|---|
|  |  |  | import com.fzzy.api.entity.Api1304; | 
|---|
|  |  |  | import com.fzzy.api.entity.Api1305; | 
|---|
|  |  |  | import com.fzzy.api.entity.ApiLog; | 
|---|
|  |  |  | import com.fzzy.api.entity.*; | 
|---|
|  |  |  | import com.fzzy.api.service.ApiCommonService; | 
|---|
|  |  |  | import com.fzzy.api.utils.ContextUtil; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.Api1304Rep; | 
|---|
|  |  |  | 
|---|
|  |  |  | * @param start  起始时间 | 
|---|
|  |  |  | * @param end    截止时间 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public void syncData(String deptId, Date start, Date end) { | 
|---|
|  |  |  | public void syncData(String kqdm, String deptId, Date start, Date end) { | 
|---|
|  |  |  | log.info("-------------1305接口数据开始同步------------------"); | 
|---|
|  |  |  | //同步数据,只记录失败的信息 | 
|---|
|  |  |  | ApiLog apiLog = new ApiLog(); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Api1305 api1305; | 
|---|
|  |  |  | Api1105 api1105; | 
|---|
|  |  |  | List<Api1305> api1305List; | 
|---|
|  |  |  | for (Fz40AreationData fzAreationData : list) { | 
|---|
|  |  |  | //获取货位信息 | 
|---|
|  |  |  | api1105 = commonService.getApi1105Cache(fzAreationData.getDepotId()); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BeanUtils.copyProperties(fzAreationData, api1305); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | api1305.setTfzydh(fzAreationData.getId()); | 
|---|
|  |  |  | api1305.setTfzydh(api1105.getHwdm() + fzAreationData.getId()); | 
|---|
|  |  |  | api1305.setTfrq(fzAreationData.getStartTime()); | 
|---|
|  |  |  | api1305.setCfdm(fzAreationData.getDeptId()); | 
|---|
|  |  |  | api1305.setCfdm(api1105.getHwdm().substring(0,25)); | 
|---|
|  |  |  | api1305.setTfmd(fzAreationData.getObjective()); | 
|---|
|  |  |  | api1305.setTflx(fzAreationData.getType()); | 
|---|
|  |  |  | api1305.setFdxs(fzAreationData.getWindNetType()); | 
|---|
|  |  |  | 
|---|
|  |  |  | api1305.setTfzyfzr(fzAreationData.getChargeUser()); | 
|---|
|  |  |  | api1305.setTfzyry(fzAreationData.getOperators()); | 
|---|
|  |  |  | api1305.setTfsc(fzAreationData.getLongTime()); | 
|---|
|  |  |  | api1305.setZhgxsj(fzAreationData.getUpdateTime()); | 
|---|
|  |  |  | api1305.setZhgxsj(new Date()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | api1305.setKqdm(kqdm); | 
|---|
|  |  |  | api1305.setHwdm(api1105.getHwdm()); | 
|---|
|  |  |  | api1305.setBizId(fzAreationData.getId()); | 
|---|
|  |  |  | api1305List = api1305Rep.getDataById(api1305.getTfzydh()); | 
|---|
|  |  |  | if (null == api1305List || api1305List.isEmpty()) { | 
|---|
|  |  |  | api1305.setCzbz(Constant.CZBZ_I); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | api1305.setCzbz(api1305List.get(0).getCzbz()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | api1305Rep.save(api1305); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|