1.口门门禁-检查部门初始化-新增部门车辆信息

koumen
guoyuepeng 2025-11-20 16:30:59 +08:00
parent 3c84472af5
commit 30403abd28
8 changed files with 89 additions and 18 deletions

View File

@ -45,11 +45,6 @@ public class InspectionDeptController {
return inspectionDeptService.listPage(qry);
}
@ApiOperation("所有数据")
@GetMapping("/listAll")
public MultiResponse<InspectionDeptCO> listAll() {
return MultiResponse.of(new ArrayList<InspectionDeptCO>());
}
@ApiOperation("详情")
@GetMapping("/{id}")
@ -64,13 +59,6 @@ public class InspectionDeptController {
return SingleResponse.buildSuccess();
}
@ApiOperation("删除多个")
@DeleteMapping("/ids")
public Response removeBatch(@RequestParam Long[] ids) {
inspectionDeptService.removeBatch(ids);
return SingleResponse.buildSuccess();
}
@ApiOperation("修改")
@PutMapping("/edit")
public SingleResponse edit(@Validated @RequestBody InspectionDeptUpdateCmd inspectionDeptUpdateCmd) {

View File

@ -2,8 +2,13 @@ package com.zcloud.primeport.command;
import com.alibaba.cola.exception.BizException;
import com.zcloud.primeport.domain.gateway.InspectionDeptGateway;
import com.zcloud.primeport.domain.gateway.InspectionVehicleGateway;
import com.zcloud.primeport.domain.gateway.VehicleMessageGateway;
import com.zcloud.primeport.domain.model.InspectionDeptE;
import com.zcloud.primeport.domain.model.InspectionVehicleE;
import com.zcloud.primeport.domain.model.VehicleMessageE;
import com.zcloud.primeport.dto.InspectionDeptAddCmd;
import com.zcloud.primeport.dto.VehicleInspectionAddCmd;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
@ -20,14 +25,28 @@ import org.springframework.transaction.annotation.Transactional;
@AllArgsConstructor
public class InspectionDeptAddExe {
private final InspectionDeptGateway inspectionDeptGateway;
private final InspectionVehicleGateway inspectionVehicleGateway;
private final VehicleMessageGateway vehicleMessageGateway;
@Transactional(rollbackFor = Exception.class)
public boolean execute(InspectionDeptAddCmd cmd) {
InspectionDeptE examTypeE = new InspectionDeptE();
BeanUtils.copyProperties(cmd, examTypeE);
boolean res = false;
try {
res = inspectionDeptGateway.add(examTypeE);
InspectionDeptE insDeptAdd = inspectionDeptGateway.add(examTypeE);
/**
* 1.
* 2.
*/
for (VehicleInspectionAddCmd vehicleInspectionAddCmd : cmd.getVehicleMessageAddCmd()) {
VehicleMessageE vehicleMessageE = new VehicleMessageE();
BeanUtils.copyProperties(vehicleInspectionAddCmd, vehicleMessageE);
vehicleMessageE.VehicleMessageForInspection(vehicleMessageE);
VehicleMessageE vehicleAdd = vehicleMessageGateway.add(vehicleMessageE);// 添加车辆信息
InspectionVehicleE inspectionVehicleE = new InspectionVehicleE();
inspectionVehicleE.addDeptInspection(insDeptAdd.getId(),vehicleAdd.getId()); //车辆和部门之间的关系
res = inspectionVehicleGateway.add(inspectionVehicleE);
}
} catch (Exception e) {
throw new RuntimeException(e);
}

View File

@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* web-client
@ -21,11 +22,15 @@ import javax.validation.constraints.NotEmpty;
@NoArgsConstructor
@AllArgsConstructor
public class InspectionDeptAddCmd extends Command {
@ApiModelProperty(value = "主键", name = "id", required = true)
@NotEmpty(message = "主键不能为空")
private Long id;
@ApiModelProperty(value = "名称", name = "name", required = true)
@NotEmpty(message = "名称不能为空")
private String name;
@ApiModelProperty(value = "单位车辆信息部门为空", name = "VehicleMessageAddCmd", required = true)
@NotEmpty(message = "单位车辆信息部门为空")
List<VehicleInspectionAddCmd> VehicleMessageAddCmd;
}

View File

@ -0,0 +1,42 @@
package com.zcloud.primeport.dto;
import com.alibaba.cola.dto.Command;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotEmpty;
import java.util.Date;
/**
* web-client
*
* @Author guoyuepeng
* @Date 2025-11-15 11:41:21
*/
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class VehicleInspectionAddCmd extends Command {
@ApiModelProperty(value = "车牌类型 0-白牌 1- 蓝牌 2-黄牌 3-绿牌 4-黑牌", name = "licenceType", required = true)
@NotEmpty(message = "车牌类型 0-白牌 1- 蓝牌 2-黄牌 3-绿牌 4-黑牌不能为空")
private Integer licenceType;
@ApiModelProperty(value = "车牌号", name = "licenceNo", required = true)
@NotEmpty(message = "车牌号不能为空")
private String licenceNo;
@ApiModelProperty(value = "车辆类型", name = "vehicleType", required = true)
@NotEmpty(message = "车辆类型不能为空")
private String vehicleType;
@ApiModelProperty(value = "访问起始时间", name = "visitStartTime", required = true)
@NotEmpty(message = "访问起始时间不能为空")
private Date visitStartTime;
@ApiModelProperty(value = "访问结束时间", name = "visitEndTime", required = true)
@NotEmpty(message = "访问结束时间不能为空")
private Date visitEndTime;
}

View File

@ -13,7 +13,7 @@ public interface InspectionDeptGateway {
/**
*
*/
Boolean add(InspectionDeptE inspectionDeptE);
InspectionDeptE add(InspectionDeptE inspectionDeptE);
/**
*

View File

@ -21,5 +21,12 @@ public class InspectionVehicleE extends BaseE {
//车辆id
private Long vehicleMessageId;
public void addDeptInspection(Long inspectionDeptId, Long vehicleMessageId) {
this.inspectionDeptId = inspectionDeptId;
this.vehicleMessageId = vehicleMessageId;
}
}

View File

@ -29,7 +29,7 @@ public class VehicleMessageE extends BaseE {
private String licenceNo;
//车辆类型
private String vehicleType;
//车辆所属类型 0-员工车辆 1- 单位车辆 2-相关方车辆3货运车辆,4:临时车辆
//车辆所属类型 0-员工车辆 1- 单位车辆 2-相关方车辆3货运车辆,4:临时车辆 5 检查车
private Integer vehicleBelongType;
//所属车队ID
private Long motorcadeId;
@ -77,5 +77,14 @@ public class VehicleMessageE extends BaseE {
this.isAudit = 0;//未审核
return e;
}
public void VehicleMessageForInspection( VehicleMessageE e) {
this.vehicleBelongType = 5;//未审核
this.isDangerous = 0;
this.portId = 0;
this.isAudit = 2 ;
this.mkmjPermission = 2;
}
}

View File

@ -22,11 +22,12 @@ public class InspectionDeptGatewayImpl implements InspectionDeptGateway {
private final InspectionDeptRepository inspectionDeptRepository;
@Override
public Boolean add(InspectionDeptE inspectionDeptE) {
public InspectionDeptE add(InspectionDeptE inspectionDeptE) {
InspectionDeptDO d = new InspectionDeptDO();
BeanUtils.copyProperties(inspectionDeptE, d);
inspectionDeptRepository.save(d);
return true;
BeanUtils.copyProperties(d, inspectionDeptE);
return inspectionDeptE;
}
@Override