1.口门门禁-检查部门初始化-新增部门车辆信息
parent
3c84472af5
commit
30403abd28
|
|
@ -45,11 +45,6 @@ public class InspectionDeptController {
|
||||||
return inspectionDeptService.listPage(qry);
|
return inspectionDeptService.listPage(qry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("所有数据")
|
|
||||||
@GetMapping("/listAll")
|
|
||||||
public MultiResponse<InspectionDeptCO> listAll() {
|
|
||||||
return MultiResponse.of(new ArrayList<InspectionDeptCO>());
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("详情")
|
@ApiOperation("详情")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
|
|
@ -64,13 +59,6 @@ public class InspectionDeptController {
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除多个")
|
|
||||||
@DeleteMapping("/ids")
|
|
||||||
public Response removeBatch(@RequestParam Long[] ids) {
|
|
||||||
inspectionDeptService.removeBatch(ids);
|
|
||||||
return SingleResponse.buildSuccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("修改")
|
@ApiOperation("修改")
|
||||||
@PutMapping("/edit")
|
@PutMapping("/edit")
|
||||||
public SingleResponse edit(@Validated @RequestBody InspectionDeptUpdateCmd inspectionDeptUpdateCmd) {
|
public SingleResponse edit(@Validated @RequestBody InspectionDeptUpdateCmd inspectionDeptUpdateCmd) {
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,13 @@ package com.zcloud.primeport.command;
|
||||||
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
import com.zcloud.primeport.domain.gateway.InspectionDeptGateway;
|
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.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.InspectionDeptAddCmd;
|
||||||
|
import com.zcloud.primeport.dto.VehicleInspectionAddCmd;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -20,14 +25,28 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class InspectionDeptAddExe {
|
public class InspectionDeptAddExe {
|
||||||
private final InspectionDeptGateway inspectionDeptGateway;
|
private final InspectionDeptGateway inspectionDeptGateway;
|
||||||
|
private final InspectionVehicleGateway inspectionVehicleGateway;
|
||||||
|
private final VehicleMessageGateway vehicleMessageGateway;
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(InspectionDeptAddCmd cmd) {
|
public boolean execute(InspectionDeptAddCmd cmd) {
|
||||||
InspectionDeptE examTypeE = new InspectionDeptE();
|
InspectionDeptE examTypeE = new InspectionDeptE();
|
||||||
BeanUtils.copyProperties(cmd, examTypeE);
|
BeanUtils.copyProperties(cmd, examTypeE);
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
try {
|
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) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-client
|
* web-client
|
||||||
|
|
@ -21,11 +22,15 @@ import javax.validation.constraints.NotEmpty;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class InspectionDeptAddCmd extends Command {
|
public class InspectionDeptAddCmd extends Command {
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键", name = "id", required = true)
|
@ApiModelProperty(value = "主键", name = "id", required = true)
|
||||||
@NotEmpty(message = "主键不能为空")
|
@NotEmpty(message = "主键不能为空")
|
||||||
private Long id;
|
private Long id;
|
||||||
@ApiModelProperty(value = "名称", name = "name", required = true)
|
@ApiModelProperty(value = "名称", name = "name", required = true)
|
||||||
@NotEmpty(message = "名称不能为空")
|
@NotEmpty(message = "名称不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
|
@ApiModelProperty(value = "单位车辆信息部门为空", name = "VehicleMessageAddCmd", required = true)
|
||||||
|
@NotEmpty(message = "单位车辆信息部门为空")
|
||||||
|
List<VehicleInspectionAddCmd> VehicleMessageAddCmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@ public interface InspectionDeptGateway {
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
Boolean add(InspectionDeptE inspectionDeptE);
|
InspectionDeptE add(InspectionDeptE inspectionDeptE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,12 @@ public class InspectionVehicleE extends BaseE {
|
||||||
//车辆id
|
//车辆id
|
||||||
private Long vehicleMessageId;
|
private Long vehicleMessageId;
|
||||||
|
|
||||||
|
|
||||||
|
public void addDeptInspection(Long inspectionDeptId, Long vehicleMessageId) {
|
||||||
|
this.inspectionDeptId = inspectionDeptId;
|
||||||
|
this.vehicleMessageId = vehicleMessageId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public class VehicleMessageE extends BaseE {
|
||||||
private String licenceNo;
|
private String licenceNo;
|
||||||
//车辆类型
|
//车辆类型
|
||||||
private String vehicleType;
|
private String vehicleType;
|
||||||
//车辆所属类型 0-员工车辆 1- 单位车辆 2-相关方车辆3:货运车辆,4:临时车辆
|
//车辆所属类型 0-员工车辆 1- 单位车辆 2-相关方车辆3:货运车辆,4:临时车辆 5 检查车
|
||||||
private Integer vehicleBelongType;
|
private Integer vehicleBelongType;
|
||||||
//所属车队ID
|
//所属车队ID
|
||||||
private Long motorcadeId;
|
private Long motorcadeId;
|
||||||
|
|
@ -77,5 +77,14 @@ public class VehicleMessageE extends BaseE {
|
||||||
this.isAudit = 0;//未审核
|
this.isAudit = 0;//未审核
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void VehicleMessageForInspection( VehicleMessageE e) {
|
||||||
|
this.vehicleBelongType = 5;//未审核
|
||||||
|
this.isDangerous = 0;
|
||||||
|
this.portId = 0;
|
||||||
|
this.isAudit = 2 ;
|
||||||
|
this.mkmjPermission = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,12 @@ public class InspectionDeptGatewayImpl implements InspectionDeptGateway {
|
||||||
private final InspectionDeptRepository inspectionDeptRepository;
|
private final InspectionDeptRepository inspectionDeptRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean add(InspectionDeptE inspectionDeptE) {
|
public InspectionDeptE add(InspectionDeptE inspectionDeptE) {
|
||||||
InspectionDeptDO d = new InspectionDeptDO();
|
InspectionDeptDO d = new InspectionDeptDO();
|
||||||
BeanUtils.copyProperties(inspectionDeptE, d);
|
BeanUtils.copyProperties(inspectionDeptE, d);
|
||||||
inspectionDeptRepository.save(d);
|
inspectionDeptRepository.save(d);
|
||||||
return true;
|
BeanUtils.copyProperties(d, inspectionDeptE);
|
||||||
|
return inspectionDeptE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue