瀏覽代碼

提交获取指令功能

master
梁超 1 月之前
父節點
當前提交
055623b034

+ 27
- 0
zhywpt-service-inss/src/main/java/cn/com/taiji/inss/manager/inst/InstOnlineActiveMananger.java 查看文件

@@ -12,6 +12,7 @@ import cn.com.taiji.core.entity.invw.InvwCardDetails;
import cn.com.taiji.core.entity.invw.InvwObuDetails;
import cn.com.taiji.core.entity.issue.IssueOrderinfo;
import cn.com.taiji.core.entity.issue.IssueProduct;
import cn.com.taiji.core.entity.managew.ActiveRecord;
import cn.com.taiji.core.manager.tools.issue.QdCallUtil;
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzCardUploadRequest;
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzObuUploadRequest;
@@ -24,12 +25,18 @@ import cn.com.taiji.core.repo.jpa.invw.InvwCardDetailsRepo;
import cn.com.taiji.core.repo.jpa.invw.InvwObuDetailsRepo;
import cn.com.taiji.core.repo.jpa.issue.IssueOrderinfoRepo;
import cn.com.taiji.core.repo.jpa.issue.IssueProductRepo;
import cn.com.taiji.core.repo.jpa.managew.ActiveRecordRepo;
import cn.com.taiji.inss.manager.model.inst.IssueOrderVO;
import cn.com.taiji.inss.manager.tools.InstTools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
@@ -104,6 +111,7 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager {
private QtkVehicleInfo vehicleInfo;
private InvwCardDetails cardDetails;
private InvwObuDetails obuDetails;
private ActiveRecordRepo activeRecordRepo;

@PostConstruct
public void init() {
@@ -285,6 +293,8 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager {
obuDetails.setUseType(OrderType.ISSUE);
obuDetails.setStatus(InvDeviceStatus.USED);
obuDetailsRepo.save(obuDetails);
// 激活记录
saveActiveRecord(orderInfo);
//同步老库
persistTransaction(ISSUE_ORDER_SYNC, vo.getOrderId(), "order");
persistTransaction(ISSUE_USER_SYNC, vo.getOrderId(), "user");
@@ -299,6 +309,23 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager {
}
}

private void saveActiveRecord(IssueOrderinfo orderInfo) {
ActiveRecord record = new ActiveRecord();
record.setOpenId(orderInfo.getUserId());
record.setType(1);
record.setActiveType(1);
record.setSourceType(orderInfo.getOrderSource());
record.setVehicleId(orderInfo.getVehicleId());
record.setVehiclePlate(orderInfo.getVehiclePlate());
record.setVehiclePlateColor(orderInfo.getVehiclePlateColor());
record.setCardId(orderInfo.getCardId());
record.setCardType(orderInfo.getCardType());
record.setObuId(orderInfo.getObuId());
record.setActiveTime(LocalDateTime.now());
record.setResetStatus(0);
activeRecordRepo.persist(record);
}

private YgzUserUploadRequest handleUser() {
YgzUserUploadRequest request = new YgzUserUploadRequest();
request.setDataSource(DataSourceEnum.DSI_INTERFACE);

Loading…
取消
儲存