1.一级口门审批
parent
679297530d
commit
429446edb7
|
|
@ -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 {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,4 +48,3 @@ public interface VehicleMessageGateway {
|
|||
Integer countByUserId(Long userId);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue