|
|
@@ -143,25 +143,42 @@ public class ActiveManagerImpl extends AbstractCommManager implements ActiveMana |
|
|
|
}else { |
|
|
|
// 非本人办理,查询车辆信息表 |
|
|
|
QtkVehicleInfo info = vehicleInfoRepo.findByVehicleId(requestDTO.getVehicleId()); |
|
|
|
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(requestDTO.getAccessToken())); |
|
|
|
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; |
|
|
|
IssueOrderinfo orderinfo = issueOrderinfoRepo.findNormalByVehicleId(requestDTO.getVehicleId()); |
|
|
|
if (orderinfo != null){ // 首次激活 |
|
|
|
if (staff != null){ |
|
|
|
if (staff.getAgencyId() != orderinfo.getAgencyId()){ |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
DeviceReactivateModel model = new DeviceReactivateModel(); |
|
|
|
BeanTools.copyProperties(orderinfo, model); |
|
|
|
model.setMobile(customerInfo.getCustomerTel()); |
|
|
|
model.setVehicleType(info.getType()); |
|
|
|
model.setOrderId(orderinfo.getId()); |
|
|
|
model.setActiveType(1); |
|
|
|
list.add(model); |
|
|
|
}else { // 二次激活 |
|
|
|
QtkCardInfo cardInfo = cardInfoRepo.findByVehicleIdAndCardStatus(requestDTO.getVehicleId(), CardStatus.ZC); |
|
|
|
QtkObuInfo obuInfo = obuInfoRepo.findByVehicleIdAndObuStatus(requestDTO.getVehicleId(), ObuStatus.ZC); |
|
|
|
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); |
|
|
|
} |
|
|
|
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(); |
|
|
|
resDTO.setModelList(list); |