|
|
@@ -8,6 +8,8 @@ import cn.com.taiji.common.manager.net.http.ServiceHandleException; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkObuInfo; |
|
|
|
import cn.com.taiji.core.entity.dict.basic.CardStatus; |
|
|
|
import cn.com.taiji.core.entity.dict.basic.ObuStatus; |
|
|
|
import cn.com.taiji.core.entity.user.Staff; |
|
|
|
import cn.com.taiji.core.repo.jpa.user.StaffRepo; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@@ -60,6 +62,8 @@ public class ActiveManagerImpl extends AbstractCommManager implements ActiveMana |
|
|
|
private QtkCardInfoRepo cardInfoRepo; |
|
|
|
@Autowired |
|
|
|
private QtkObuInfoRepo obuInfoRepo; |
|
|
|
@Autowired |
|
|
|
private StaffRepo staffRepo; |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增激活记录 |
|
|
@@ -142,11 +146,21 @@ public class ActiveManagerImpl extends AbstractCommManager implements ActiveMana |
|
|
|
if(info == null){ |
|
|
|
throw new ManagerException("未查到车辆信息!"); |
|
|
|
} |
|
|
|
QtkCardInfo cardInfo = cardInfoRepo.findByVehicleIdAndCardStatus(requestDTO.getVehicleId(), CardStatus.ZC); |
|
|
|
QtkObuInfo obuInfo = obuInfoRepo.findByVehicleIdAndObuStatus(requestDTO.getVehicleId(), ObuStatus.ZC); |
|
|
|
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(requestDTO.getAccessToken())); |
|
|
|
if (staff != null){ |
|
|
|
if (staff.getAgencyId() != cardInfo.getAgencyId()){ |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
DeviceReactivateModel model = new DeviceReactivateModel(); |
|
|
|
BeanTools.copyProperties(info, model); |
|
|
|
model.setVehicleType(info.getType()); |
|
|
|
model.setMobile(customerInfo.getCustomerTel()); |
|
|
|
model.setActiveType(2); |
|
|
|
model.setCardId(cardInfo.getCardId()); |
|
|
|
model.setObuId(obuInfo.getObuId()); |
|
|
|
list.add(model); |
|
|
|
} |
|
|
|
QueryVehicleResponseDTO resDTO = new QueryVehicleResponseDTO(); |