@@ -1,6 +1,7 @@ | |||
package cn.com.taiji.core.repo.jpa.invw; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.dict.invw.InvDeviceStatus; | |||
import cn.com.taiji.core.entity.invw.InvwCardDetails; | |||
import org.springframework.data.jpa.repository.Modifying; | |||
import org.springframework.data.jpa.repository.Query; | |||
@@ -19,13 +20,13 @@ public interface InvwCardDetailsRepo extends AbstractJpaRepo<InvwCardDetails, St | |||
//根据设备编号范围查询库存 | |||
@Query(value = "select count(id) from InvwCardDetails where storeCode = ?1 and status = ?2 and cardId >= ?3 and cardId <= ?4 ") | |||
// long findCountByStoreCodeStatusCardId(String storeCode, InvDeviceStatus status, String cardIdStart, String cardIdEnd); | |||
long findCountByStoreCodeStatusCardId(String storeCode, Integer status, String cardIdStart, String cardIdEnd); | |||
long findCountByStoreCodeStatusCardId(String storeCode, InvDeviceStatus status, String cardIdStart, String cardIdEnd); | |||
// long findCountByStoreCodeStatusCardId(String storeCode, Integer status, String cardIdStart, String cardIdEnd); | |||
//修改卡的所属仓库 | |||
@Modifying | |||
@Transactional | |||
@Query(value = "update InvwCardDetails set storeCode = ?1,agencyId=?2,channelId=?3 " + | |||
" where storeCode = ?4 and status = ?5 and cardId >= ?6 and cardId <= ?7") | |||
int updateStoreCodeByStoreCode(String storeCode, String agencyId, String channelId, String oldStoreCode, Integer status, String cardIdStart, String cardIdEnd); | |||
int updateStoreCodeByStoreCode(String storeCode, String agencyId, String channelId, String oldStoreCode, InvDeviceStatus status, String cardIdStart, String cardIdEnd); | |||
} |
@@ -145,7 +145,7 @@ public class InvwTransferApplyManagerImpl extends AbstractCommManager implements | |||
if(transferApply.getInventoryType() == InventoryType.CARD){ | |||
updateCount += cardDetailsRepo.updateStoreCodeByStoreCode(transferApply.getReceiveStoreCode(), | |||
receiveWarehouse.getAgencyId(), receiveWarehouse.getChannelId(), | |||
transferApply.getSendStoreCode(),1, detail.getStartId(), detail.getEndId()); | |||
transferApply.getSendStoreCode(),InvDeviceStatus.NEW, detail.getStartId(), detail.getEndId()); | |||
} | |||
if(transferApply.getInventoryType() == InventoryType.OBU){ | |||
updateCount += obuDetailsRepo.updateStoreCodeByStoreCode(transferApply.getReceiveStoreCode(), | |||
@@ -317,8 +317,8 @@ public class InvwTransferApplyManagerImpl extends AbstractCommManager implements | |||
long total = bLong - aLong + 1; | |||
long count = 0; | |||
if (InventoryType.CARD.name().equals(inventoryType)) { | |||
// count = cardDetailsRepo.findCountByStoreCodeStatusCardId(sendStoreCode, InvDeviceStatus.NEW, details.getStartId(), details.getEndId()); | |||
count = cardDetailsRepo.findCountByStoreCodeStatusCardId(sendStoreCode, 1, details.getStartId(), details.getEndId()); | |||
count = cardDetailsRepo.findCountByStoreCodeStatusCardId(sendStoreCode, InvDeviceStatus.NEW, details.getStartId(), details.getEndId()); | |||
// count = cardDetailsRepo.findCountByStoreCodeStatusCardId(sendStoreCode, 1, details.getStartId(), details.getEndId()); | |||
} else if (InventoryType.OBU.name().equals(inventoryType)) { | |||
count = obuDetailsRepo.findCountByStoreCodeStatusObuId(sendStoreCode, InvDeviceStatus.NEW, details.getStartId(), details.getEndId()); | |||
} else { |