瀏覽代碼

新增次数校验

master
zouhantao 3 週之前
父節點
當前提交
afc5ae4da1
共有 1 個檔案被更改,包括 12 行新增3 行删除
  1. 12
    3
      zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/ass/ActiveManagerImpl.java

+ 12
- 3
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/ass/ActiveManagerImpl.java 查看文件

@@ -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();

Loading…
取消
儲存