1.一级口门审批

koumen
guoyuepeng 2025-12-31 08:42:04 +08:00
parent 679297530d
commit 429446edb7
5 changed files with 30 additions and 9 deletions

View File

@ -7,6 +7,7 @@ import com.zcloud.primeport.domain.gateway.VehicleBlackGateway;
import com.zcloud.primeport.domain.gateway.VehicleMessageGateway;
import com.zcloud.primeport.domain.model.VehicleAuditLogE;
import com.zcloud.primeport.domain.model.VehicleMessageE;
import com.zcloud.primeport.dto.VehicleAddCheckResultDTO;
import com.zcloud.primeport.dto.VehicleMessageAddCmd;
import com.zcloud.primeport.dto.VehicleMessageForCorpAddCmd;
import lombok.AllArgsConstructor;
@ -18,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
/**
* web-app
* @Author guoyuepeng
@ -33,6 +35,10 @@ public class VehicleMessageAddExe {
public boolean execute(VehicleMessageAddCmd cmd) {
VehicleMessageE examTypeE = new VehicleMessageE();
BeanUtils.copyProperties(cmd, examTypeE);
// 检查是否可以添加车辆
boolean res = false;
try {
VehicleMessageE add = vehicleMessageGateway.add(examTypeE);
@ -82,4 +88,3 @@ public class VehicleMessageAddExe {
}
}

View File

@ -12,10 +12,6 @@ import lombok.val;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* web-app
* @Author guoyuepeng

View File

@ -75,7 +75,7 @@ public class VehicleMessageQueryExe {
VehicleMessageCO vehicleMessageCO = vehicleMessageCoConvertor.converDOsToCOs(info);
return vehicleMessageCO;
}
/**
*
* @param licenceNo
@ -93,4 +93,22 @@ public class VehicleMessageQueryExe {
public int countByUserId(Long userId) {
return vehicleMessageRepository.countByUserId(userId);
}
}
/**
*
* @param licenceNo
* @param userId
* @return
*/
public Boolean isJudgmentAdd(String licenceNo, Long userId){
boolean res = false;
if (countEnabledByLicenceNo(licenceNo) > 0) {
throw new RuntimeException("车牌号已存在");
}
if (countByUserId(userId) >= 2) {
throw new RuntimeException("你已经启用两台处理,请先禁用一个");
}
res = true;
return res;
}
}

View File

@ -48,4 +48,3 @@ public interface VehicleMessageGateway {
Integer countByUserId(Long userId);
}

View File

@ -2,6 +2,7 @@ package com.zcloud.primeport.gatewayimpl;
import com.zcloud.primeport.domain.gateway.VehicleMessageGateway;
import com.zcloud.primeport.domain.model.VehicleMessageE;
import com.zcloud.primeport.dto.VehicleAddCheckResultDTO;
import com.zcloud.primeport.persistence.dataobject.VehicleMessageDO;
import com.zcloud.primeport.persistence.repository.VehicleMessageRepository;
import lombok.AllArgsConstructor;
@ -67,6 +68,7 @@ public class VehicleMessageGatewayImpl implements VehicleMessageGateway {
BeanUtils.copyProperties(repositoryOne, vehicleMessageE);
return vehicleMessageE;
}
@Override
public Integer countEnabledByLicenceNo(String licenceNo) {
return vehicleMessageRepository.countEnabledByLicenceNo(licenceNo);
@ -77,5 +79,6 @@ public class VehicleMessageGatewayImpl implements VehicleMessageGateway {
return vehicleMessageRepository.countByUserId(userId);
}
}
}