|
|
|
|
|
|
|
|
import cn.com.taiji.core.entity.invw.InvwObuDetails; |
|
|
import cn.com.taiji.core.entity.invw.InvwObuDetails; |
|
|
import cn.com.taiji.core.entity.issue.IssueOrderinfo; |
|
|
import cn.com.taiji.core.entity.issue.IssueOrderinfo; |
|
|
import cn.com.taiji.core.entity.issue.IssueProduct; |
|
|
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.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.YgzCardUploadRequest; |
|
|
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzObuUploadRequest; |
|
|
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzObuUploadRequest; |
|
|
|
|
|
|
|
|
import cn.com.taiji.core.repo.jpa.invw.InvwObuDetailsRepo; |
|
|
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.IssueOrderinfoRepo; |
|
|
import cn.com.taiji.core.repo.jpa.issue.IssueProductRepo; |
|
|
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.model.inst.IssueOrderVO; |
|
|
import cn.com.taiji.inss.manager.tools.InstTools; |
|
|
import cn.com.taiji.inss.manager.tools.InstTools; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import javax.annotation.PostConstruct; |
|
|
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.LocalDateTime; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
private QtkVehicleInfo vehicleInfo; |
|
|
private QtkVehicleInfo vehicleInfo; |
|
|
private InvwCardDetails cardDetails; |
|
|
private InvwCardDetails cardDetails; |
|
|
private InvwObuDetails obuDetails; |
|
|
private InvwObuDetails obuDetails; |
|
|
|
|
|
private ActiveRecordRepo activeRecordRepo; |
|
|
|
|
|
|
|
|
@PostConstruct |
|
|
@PostConstruct |
|
|
public void init() { |
|
|
public void init() { |
|
|
|
|
|
|
|
|
obuDetails.setUseType(OrderType.ISSUE); |
|
|
obuDetails.setUseType(OrderType.ISSUE); |
|
|
obuDetails.setStatus(InvDeviceStatus.USED); |
|
|
obuDetails.setStatus(InvDeviceStatus.USED); |
|
|
obuDetailsRepo.save(obuDetails); |
|
|
obuDetailsRepo.save(obuDetails); |
|
|
|
|
|
// 激活记录 |
|
|
|
|
|
saveActiveRecord(orderInfo); |
|
|
//同步老库 |
|
|
//同步老库 |
|
|
persistTransaction(ISSUE_ORDER_SYNC, vo.getOrderId(), "order"); |
|
|
persistTransaction(ISSUE_ORDER_SYNC, vo.getOrderId(), "order"); |
|
|
persistTransaction(ISSUE_USER_SYNC, vo.getOrderId(), "user"); |
|
|
persistTransaction(ISSUE_USER_SYNC, vo.getOrderId(), "user"); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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() { |
|
|
private YgzUserUploadRequest handleUser() { |
|
|
YgzUserUploadRequest request = new YgzUserUploadRequest(); |
|
|
YgzUserUploadRequest request = new YgzUserUploadRequest(); |
|
|
request.setDataSource(DataSourceEnum.DSI_INTERFACE); |
|
|
request.setDataSource(DataSourceEnum.DSI_INTERFACE); |