| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 同步文件接口 |
| | | // * |
| | | // * @param deptId |
| | | // * @param start |
| | | // * @param end |
| | | // */ |
| | | // public void syncData(String kqdm, String deptId, Date start, Date end) { |
| | | // |
| | | // log.info("-------------1109接口数据开始同步------------------"); |
| | | // |
| | | // //同步数据,只记录失败的信息 |
| | | // ApiLog apiLog = new ApiLog(); |
| | | // apiLog.setType(ApiLog.TYPE_SYNC); |
| | | // apiLog.setKqdm(deptId); |
| | | // apiLog.setUploadTime(new Date()); |
| | | // apiLog.setInteId(Constant.API_CODE_1109); |
| | | // apiLog.setStatus(99); |
| | | // apiLog.setId(ContextUtil.getUUID()); |
| | | // try { |
| | | // List<Fz40FileInfo> list = fzzySync1109Rep.listFileInfo(start, end); |
| | | // |
| | | // if (null == list || list.isEmpty()) { |
| | | // log.info("-------------没有获取到文件信息------------------"); |
| | | // return; |
| | | // } |
| | | // |
| | | // Map<String, Integer> map = new HashMap<>(); |
| | | // Api1109 apiData; |
| | | // String wjlx; |
| | | // String wjmc; |
| | | // List<Api1109> api1109List; |
| | | // List<Api1202> api1202List; |
| | | // List<Api1205> api1205List; |
| | | // String str = ""; |
| | | // for (Fz40FileInfo sysData : list) { |
| | | // if (StringUtils.isEmpty(sysData.getBizId())) { |
| | | // continue; |
| | | // } |
| | | // //根据图片id查询对应出入库信息 |
| | | // if(sysData.getBizId().startsWith(IMG_START_R)){ |
| | | // api1202List = api1202Rep.getDataByBizId(sysData.getBizId()); |
| | | // if (null == api1202List || api1202List.isEmpty()) { |
| | | // continue; |
| | | // } |
| | | // str = api1202List.get(0).getRkywdh(); |
| | | // } |
| | | // if(sysData.getBizId().startsWith(IMG_START_C)){ |
| | | // api1205List = api1205Rep.getDataByBizId(sysData.getBizId()); |
| | | // if (null == api1205List || api1205List.isEmpty()) { |
| | | // continue; |
| | | // } |
| | | // str = api1205List.get(0).getCkywdh(); |
| | | // } |
| | | // |
| | | // //只同步称重 |
| | | // if (BIZ_TAG_WEIGHT_FULL.equals(sysData.getBizTag()) || BIZ_TAG_WEIGHT_EMPTY.equals(sysData.getBizTag())) { |
| | | // wjlx = ""; |
| | | // wjmc = kqdm; |
| | | // //入库抓拍图 |
| | | // if (sysData.getBizId().startsWith(IMG_START_R)) { |
| | | // wjlx = IMG_TYPE_2; |
| | | // wjmc += "_" + Constant.INOUT_TYPE_14 + sysData.getBizId().substring(4); |
| | | // } |
| | | // //出库抓拍图 |
| | | // if (sysData.getBizId().startsWith(IMG_START_C)) { |
| | | // wjlx = IMG_TYPE_3; |
| | | // wjmc += "_" + Constant.INOUT_TYPE_15 + sysData.getBizId().substring(4); |
| | | // } |
| | | // //若文件类型为空,则跳过 |
| | | // if (StringUtils.isEmpty(wjlx)) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // apiData = new Api1109(); |
| | | // |
| | | // //主键id |
| | | // apiData.setId(UUID.randomUUID().toString()); |
| | | // //文件路径 |
| | | // apiData.setWjdz(fileUtil.getInoutFilePath(sysData.getCreateTime()) + sysData.getFileName()); |
| | | // |
| | | // //文件名称 |
| | | // wjmc = getImgNameType(wjmc, sysData.getBizTag(), str, sysData.getFileName(), map); |
| | | // apiData.setWjmc(wjmc); |
| | | // //文件类型 |
| | | // apiData.setWjlx(wjlx); |
| | | // |
| | | // //操作标志及最后更新时间 |
| | | // apiData.setZhgxsj(sysData.getCreateTime()); |
| | | // |
| | | // //业务id、库区编码、同步时间 |
| | | // apiData.setBizId(sysData.getFileId()); |
| | | // apiData.setKqdm(kqdm); |
| | | // apiData.setSyncTime(new Date()); |
| | | // |
| | | // api1109List = api1109Rep.getDataByBizId(apiData.getBizId()); |
| | | // if (null == api1109List || api1109List.isEmpty()) { |
| | | // apiData.setCzbz(Constant.CZBZ_I); |
| | | // } else { |
| | | // apiData.setCzbz(api1109List.get(0).getCzbz()); |
| | | // } |
| | | // |
| | | // //保存数据 |
| | | // api1109Rep.save(apiData); |
| | | // log.info("1109---同步数据:{}", apiData.toString()); |
| | | // } |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("---文件同步执行失败----{}", e); |
| | | // apiLog.setResult("同步文件信息失败:" + e.getMessage()); |
| | | // apiLogRep.save(apiLog); |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * 获取图片命名类型 |
| | | * |