| | |
| | | |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.entity.Api1109; |
| | | import com.fzzy.api.entity.Api1202; |
| | | import com.fzzy.api.entity.Api1205; |
| | | import com.fzzy.api.entity.ApiLog; |
| | | import com.fzzy.api.utils.ContextUtil; |
| | | import com.fzzy.api.utils.FileUtil; |
| | | import com.fzzy.api.view.repository.Api1109Rep; |
| | | import com.fzzy.api.view.repository.Api1202Rep; |
| | | import com.fzzy.api.view.repository.Api1205Rep; |
| | | import com.fzzy.api.view.repository.ApiLogRep; |
| | | import com.fzzy.async.fzzy40.entity.Fz40FileInfo; |
| | | import com.fzzy.async.fzzy40.entity.Fz40InoutRecord; |
| | | import com.fzzy.async.fzzy40.repository.Fzzy40Sync1109Rep; |
| | | import com.fzzy.async.fzzy40.repository.Fzzy40Sync1202Rep; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private Fzzy40Sync1109Rep fzzySync1109Rep; |
| | | @Autowired |
| | | private Fzzy40Sync1202Rep fzzySync1202Rep; |
| | | @Autowired |
| | | private Api1109Rep api1109Rep; |
| | | @Autowired |
| | | private Api1202Rep api1202Rep; |
| | | @Autowired |
| | | private Api1205Rep api1205Rep; |
| | | @Autowired |
| | | private ApiLogRep apiLogRep; |
| | | @Autowired |
| | |
| | | String wjlx; |
| | | String wjmc; |
| | | List<Api1109> api1109List; |
| | | List<Fz40InoutRecord> listInout; |
| | | List<Api1202> api1202List; |
| | | List<Api1205> api1205List; |
| | | String str = ""; |
| | | for (Fz40FileInfo sysData : list) { |
| | | if (StringUtils.isEmpty(sysData.getBizId())) { |
| | | continue; |
| | | } |
| | | //根据图片id查询对应出入库信息 |
| | | listInout = fzzySync1202Rep.listInoutRecordById(sysData.getBizId()); |
| | | if (null == listInout || listInout.isEmpty()) { |
| | | if(sysData.getBizId().startsWith(IMG_START_R)){ |
| | | api1202List = api1202Rep.getDataByBizId(sysData.getBizId()); |
| | | if (null == api1202List || api1202List.isEmpty()) { |
| | | continue; |
| | | } |
| | | //若出入库信息为删除或者错误状态,则不同步 |
| | | if ("DEL".equals(listInout.get(0).getRecordStatus()) || "ERROR".equals(listInout.get(0).getRecordStatus())) { |
| | | str = api1202List.get(0).getRkywdh(); |
| | | } |
| | | if(sysData.getBizId().startsWith(IMG_START_C)){ |
| | | api1205List = api1205Rep.getDataByBizId(sysData.getBizId()); |
| | | if (null == api1205List || api1205List.isEmpty()) { |
| | | continue; |
| | | } |
| | | //若出入库信息中入库重量为空或为0,则不同步 |
| | | if (null == listInout.get(0).getRecordWeight() || listInout.get(0).getRecordWeight() == 0) { |
| | | continue; |
| | | str = api1205List.get(0).getCkywdh(); |
| | | } |
| | | |
| | | //只同步称重 |
| | | if (BIZ_TAG_WEIGHT_FULL.equals(sysData.getBizTag()) || BIZ_TAG_WEIGHT_EMPTY.equals(sysData.getBizTag())) { |
| | | wjlx = ""; |
| | |
| | | apiData.setWjdz(fileUtil.getInoutFilePath(sysData.getCreateTime()) + sysData.getFileName()); |
| | | |
| | | //文件名称 |
| | | wjmc = getImgNameType(wjmc, sysData.getBizTag(), sysData.getBizId(), sysData.getFileName(), map); |
| | | wjmc = getImgNameType(wjmc, sysData.getBizTag(), str, sysData.getFileName(), map); |
| | | apiData.setWjmc(wjmc); |
| | | //文件类型 |
| | | apiData.setWjlx(wjlx); |