|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public int syncAnfmeToWeight() { | 
|---|
|  |  |  | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); | 
|---|
|  |  |  | Date date = new Date(2025, Calendar.JULY, 24); | 
|---|
|  |  |  | Date date2 = new Date(2025, Calendar.JULY, 24, 23, 59, 59); | 
|---|
|  |  |  | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() | 
|---|
|  |  |  | .ge("appe_time", format.format(date)) | 
|---|
|  |  |  | .le("appe_time", format.format(date2)) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 
|---|
|  |  |  | Date date = format.parse("2025-06-24 00:00:00"); | 
|---|
|  |  |  | Date date2 = format.parse("2025-06-24 23:59:59"); | 
|---|
|  |  |  | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() | 
|---|
|  |  |  | //                    .ge("appe_time", format.format(date)) | 
|---|
|  |  |  | //                    .le("appe_time", format.format(date2)) | 
|---|
|  |  |  | .eq("weight", -1) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int i = 0; | 
|---|
|  |  |  | for (LocDetl locDetl : locDetls) { | 
|---|
|  |  |  | // 修改库存 | 
|---|
|  |  |  | Double anfme = MatUtils.calcAnfmeFromWeight(locDetl.getMatnr(), locDetl.getAnfme()); | 
|---|
|  |  |  | locDetlService.updateAnfme(anfme, locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(), locDetl.getBrand(), | 
|---|
|  |  |  | locDetl.getStandby1(), locDetl.getStandby2(), locDetl.getStandby3(), locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3()); | 
|---|
|  |  |  | i++; | 
|---|
|  |  |  | int i = 0; | 
|---|
|  |  |  | for (LocDetl locDetl : locDetls) { | 
|---|
|  |  |  | // 修改库存 | 
|---|
|  |  |  | //                Double anfme = MatUtils.calcAnfmeFromWeight(locDetl.getMatnr(), locDetl.getAnfme()); | 
|---|
|  |  |  | locDetlService.updateAnfme(locDetl.getAnfme(), locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(), locDetl.getBrand(), | 
|---|
|  |  |  | locDetl.getStandby1(), locDetl.getStandby2(), locDetl.getStandby3(), locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3()); | 
|---|
|  |  |  | i++; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return i; | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return i; | 
|---|
|  |  |  | return 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|