|
|
|
@ -10,6 +10,7 @@ import com.gaotao.modules.automatedWarehouse.entity.WmsOrderTaskDetailData; |
|
|
|
import com.gaotao.modules.automatedWarehouse.mapper.WcsIntegrationMapper; |
|
|
|
import com.gaotao.modules.check.entity.*; |
|
|
|
import com.gaotao.modules.check.mapper.PhysicalInventoryMapper; |
|
|
|
import com.gaotao.modules.check.mapper.RfidCountSnapshotMapper; |
|
|
|
import com.gaotao.modules.check.service.PhysicalInventoryService; |
|
|
|
import com.gaotao.common.utils.R; |
|
|
|
import com.gaotao.modules.trans.entity.TransNoControl; |
|
|
|
@ -26,6 +27,7 @@ import org.springframework.util.StringUtils; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.time.*; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.Set; |
|
|
|
@ -50,6 +52,9 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl<PhysicalInventoryM |
|
|
|
@Autowired |
|
|
|
private WcsApiService wcsApiService; // rqrq - 注入WCS接口服务 |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private RfidCountSnapshotMapper rfidCountSnapshotMapper; |
|
|
|
|
|
|
|
/** 多行 VALUES 批量插入每批最大行数(count_label/count_pallet/count_result),避免 SQL Server 2100 参数上限 - rqrq */ |
|
|
|
private static final int BATCH_INSERT_MAX_ROWS = 100; |
|
|
|
|
|
|
|
@ -2502,9 +2507,18 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl<PhysicalInventoryM |
|
|
|
lastPandian = Date.from(lastDayOfLastYear.atStartOfDay(ZoneId.systemDefault()).toInstant()); |
|
|
|
|
|
|
|
} |
|
|
|
// 过期 RFID 快照归档:last_count_date < lastPandian 的写入历史,history.count_no=当前时间串 yyyyMMddHHmmss - rqrq |
|
|
|
String snapshotArchiveCountNo = DateTimeFormatter.ofPattern("yyyyMMddHHmmss") |
|
|
|
.format(LocalDateTime.now(ZoneId.of("Asia/Shanghai"))); |
|
|
|
int archivedRows = rfidCountSnapshotMapper.backupStaleSnapshotToHistoryByLastPandian(site, lastPandian, snapshotArchiveCountNo); |
|
|
|
int deletedSnapRows = rfidCountSnapshotMapper.deleteStaleRfidCountSnapshotByLastPandian(site, lastPandian); |
|
|
|
log.info("开启盘点模式 RFID 快照归档 site={} lastPandian={} archiveCountNo={} 历史插入={} 快照删除={} - rqrq", |
|
|
|
site, lastPandian, snapshotArchiveCountNo, archivedRows, deletedSnapRows); |
|
|
|
|
|
|
|
baseMapper.updateLastPandianHU(site, lastPandian); |
|
|
|
//开启盘点模式 |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
if("N".equals(nowStatus)){ |
|
|
|
throw new RuntimeException("盘点模式已关闭,无需重复关闭"); |
|
|
|
|