|
|
@@ -69,12 +69,20 @@ public class ActiveManagerImpl extends AbstractCommManager implements ActiveMana |
|
|
|
public SaveRecordResponseDTO saveRecord(SaveRecordRequestDTO requestDTO) throws ManagerException { |
|
|
|
// 查找orderInfo |
|
|
|
IssueOrderinfo orderInfo = issueOrderinfoRepo.findByOrderNo(requestDTO.getOrderNo()); |
|
|
|
AssOrderinfo assOrderinfo = new AssOrderinfo(); |
|
|
|
if (orderInfo == null){ |
|
|
|
throw new ManagerException("未查到订单表!"); |
|
|
|
assOrderinfo = assOrderinfoRepo.findByOrderNo(requestDTO.getOrderNo()); |
|
|
|
if (assOrderinfo == null){ |
|
|
|
throw new ManagerException("未查到订单信息!"); |
|
|
|
} |
|
|
|
} |
|
|
|
// 封装数据 |
|
|
|
ActiveRecord record = new ActiveRecord(); |
|
|
|
BeanTools.copyProperties(orderInfo, record,"id"); |
|
|
|
if (orderInfo == null){ |
|
|
|
BeanTools.copyProperties(assOrderinfo, record,"id"); |
|
|
|
}else { |
|
|
|
BeanTools.copyProperties(orderInfo, record,"id"); |
|
|
|
} |
|
|
|
BeanTools.copyProperties(requestDTO, record); |
|
|
|
record.setOpenId(findOpenIdByToken(requestDTO.getAccessToken())); |
|
|
|
record.setActiveTime(LocalDateTime.now()); |
|
|
@@ -165,7 +173,7 @@ public class ActiveManagerImpl extends AbstractCommManager implements ActiveMana |
|
|
|
assOrderinfo.setApplyTime(now); |
|
|
|
assOrderinfo.setInsertTime(now); |
|
|
|
assOrderinfo.setUpdateTime(now); |
|
|
|
assOrderinfoRepo.persist(assOrderinfo); |
|
|
|
AssOrderinfo save = assOrderinfoRepo.save(assOrderinfo); |
|
|
|
// 存二次激活记录 |
|
|
|
AssDeviceReactivate deviceReactivate = new AssDeviceReactivate(); |
|
|
|
BeanTools.copyProperties(requestDTO, deviceReactivate); |
|
|
@@ -174,6 +182,7 @@ public class ActiveManagerImpl extends AbstractCommManager implements ActiveMana |
|
|
|
deviceReactivateRepo.persist(deviceReactivate); |
|
|
|
// 保存激活记录 |
|
|
|
SaveRecordRequestDTO saveRecordRequestDTO = new SaveRecordRequestDTO(); |
|
|
|
saveRecordRequestDTO.setOrderNo(save.getOrderNo()); |
|
|
|
BeanTools.copyProperties(requestDTO, saveRecordRequestDTO); |
|
|
|
saveRecord(saveRecordRequestDTO); |
|
|
|
return new ActivateDetailsResponseDTO(); |