1.口门门禁-审批流程申请1
parent
9599de6232
commit
b5a5405836
|
|
@ -1,7 +1,10 @@
|
||||||
package com.zcloud.primeport.command;
|
package com.zcloud.primeport.command;
|
||||||
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
|
import com.zcloud.primeport.domain.gateway.VehicleAuditLogGateway;
|
||||||
import com.zcloud.primeport.domain.gateway.VehicleMessageGateway;
|
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.domain.model.VehicleMessageE;
|
||||||
import com.zcloud.primeport.dto.VehicleMessageAddCmd;
|
import com.zcloud.primeport.dto.VehicleMessageAddCmd;
|
||||||
import com.zcloud.primeport.dto.VehicleMessageForCorpAddCmd;
|
import com.zcloud.primeport.dto.VehicleMessageForCorpAddCmd;
|
||||||
|
|
@ -22,14 +25,14 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class VehicleMessageAddExe {
|
public class VehicleMessageAddExe {
|
||||||
private final VehicleMessageGateway vehicleMessageGateway;
|
private final VehicleMessageGateway vehicleMessageGateway;
|
||||||
|
private final VehicleAuditLogGateway vehicleAuditLogGateway;
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(VehicleMessageAddCmd cmd) {
|
public boolean execute(VehicleMessageAddCmd cmd) {
|
||||||
VehicleMessageE examTypeE = new VehicleMessageE();
|
VehicleMessageE examTypeE = new VehicleMessageE();
|
||||||
BeanUtils.copyProperties(cmd, examTypeE);
|
BeanUtils.copyProperties(cmd, examTypeE);
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
try {
|
try {
|
||||||
res = vehicleMessageGateway.add(examTypeE);
|
VehicleMessageE add = vehicleMessageGateway.add(examTypeE);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +49,13 @@ public class VehicleMessageAddExe {
|
||||||
examTypeE = examTypeE.VehicleMessageForCorpE(examTypeE);
|
examTypeE = examTypeE.VehicleMessageForCorpE(examTypeE);
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
try {
|
try {
|
||||||
res = vehicleMessageGateway.add(examTypeE);
|
VehicleMessageE add = vehicleMessageGateway.add(examTypeE);
|
||||||
|
if (!Tools.isEmpty(cmd.getApprovalUserId())){
|
||||||
|
VehicleAuditLogE vehicleAuditLogE = new VehicleAuditLogE();
|
||||||
|
BeanUtils.copyProperties(cmd, vehicleAuditLogE);
|
||||||
|
vehicleAuditLogE.addFroVehicleLog(vehicleAuditLogE,add.getId()); // 添加审批信息
|
||||||
|
res = vehicleAuditLogGateway.add(vehicleAuditLogE); // 添加审批信息
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ public class VehicleAuditLogAddCmd extends Command {
|
||||||
private String vehicleAuditLogId;
|
private String vehicleAuditLogId;
|
||||||
@ApiModelProperty(value = "审批批次(审批全流程,一次申请一次id)", name = "batchId", required = true)
|
@ApiModelProperty(value = "审批批次(审批全流程,一次申请一次id)", name = "batchId", required = true)
|
||||||
@NotEmpty(message = "审批批次(审批全流程,一次申请一次id)不能为空")
|
@NotEmpty(message = "审批批次(审批全流程,一次申请一次id)不能为空")
|
||||||
private Long batchId;
|
private String batchId;
|
||||||
@ApiModelProperty(value = "车辆id", name = "vehicleMessageId", required = true)
|
@ApiModelProperty(value = "车辆id", name = "vehicleMessageId", required = true)
|
||||||
@NotEmpty(message = "车辆id不能为空")
|
@NotEmpty(message = "车辆id不能为空")
|
||||||
private Long vehicleMessageId;
|
private Long vehicleMessageId;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ public class VehicleAuditLogUpdateCmd extends Command {
|
||||||
private String vehicleAuditLogId;
|
private String vehicleAuditLogId;
|
||||||
@ApiModelProperty(value = "审批批次(审批全流程,一次申请一次id)", name = "batchId", required = true)
|
@ApiModelProperty(value = "审批批次(审批全流程,一次申请一次id)", name = "batchId", required = true)
|
||||||
@NotEmpty(message = "审批批次(审批全流程,一次申请一次id)不能为空")
|
@NotEmpty(message = "审批批次(审批全流程,一次申请一次id)不能为空")
|
||||||
private Long batchId;
|
private String batchId;
|
||||||
@ApiModelProperty(value = "车辆id", name = "vehicleMessageId", required = true)
|
@ApiModelProperty(value = "车辆id", name = "vehicleMessageId", required = true)
|
||||||
@NotEmpty(message = "车辆id不能为空")
|
@NotEmpty(message = "车辆id不能为空")
|
||||||
private Long vehicleMessageId;
|
private Long vehicleMessageId;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-client
|
* web-client
|
||||||
|
|
@ -23,7 +24,7 @@ import javax.validation.constraints.NotEmpty;
|
||||||
public class VehicleMessageForCorpAddCmd extends Command {
|
public class VehicleMessageForCorpAddCmd extends Command {
|
||||||
|
|
||||||
@ApiModelProperty(value = "车牌类型 0-白牌 1- 蓝牌 2-黄牌 3-绿牌 4-黑牌", name = "licenceType", required = true)
|
@ApiModelProperty(value = "车牌类型 0-白牌 1- 蓝牌 2-黄牌 3-绿牌 4-黑牌", name = "licenceType", required = true)
|
||||||
@NotEmpty(message = "车牌类型 0-白牌 1- 蓝牌 2-黄牌 3-绿牌 4-黑牌不能为空")
|
@NotNull(message = "车牌类型 0-白牌 1- 蓝牌 2-黄牌 3-绿牌 4-黑牌不能为空")
|
||||||
private Integer licenceType;
|
private Integer licenceType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "车牌号", name = "licenceNo", required = true)
|
@ApiModelProperty(value = "车牌号", name = "licenceNo", required = true)
|
||||||
|
|
@ -35,15 +36,15 @@ public class VehicleMessageForCorpAddCmd extends Command {
|
||||||
private String vehicleType;
|
private String vehicleType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "车辆所属类型 0-员工车辆 1- 单位车辆 2-外部车辆3:货运车辆", name = "vehicleBelongType", required = true)
|
@ApiModelProperty(value = "车辆所属类型 0-员工车辆 1- 单位车辆 2-外部车辆3:货运车辆", name = "vehicleBelongType", required = true)
|
||||||
@NotEmpty(message = "车辆所属类型 0-员工车辆 1- 单位车辆 2-外部车辆3:货运车辆不能为空")
|
@NotNull(message = "车辆所属类型 0-员工车辆 1- 单位车辆 2-外部车辆3:货运车辆不能为空")
|
||||||
private Integer vehicleBelongType;
|
private Integer vehicleBelongType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "通行港区(0-全部 1-东港区 2-西港区)", name = "portId", required = true)
|
@ApiModelProperty(value = "通行港区(0-全部 1-东港区 2-西港区)", name = "portId", required = true)
|
||||||
@NotEmpty(message = "通行港区(0-全部 1-东港区 2-西港区)不能为空")
|
@NotNull(message = "通行港区(0-全部 1-东港区 2-西港区)不能为空")
|
||||||
private Integer portId;
|
private Integer portId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "车辆所属部门id", name = "vehicleDepartmentId", required = true)
|
@ApiModelProperty(value = "车辆所属部门id", name = "vehicleDepartmentId", required = true)
|
||||||
@NotEmpty(message = "车辆所属部门id不能为空")
|
@NotNull(message = "车辆所属部门id不能为空")
|
||||||
private Long vehicleDepartmentId;
|
private Long vehicleDepartmentId;
|
||||||
@ApiModelProperty(value = "车辆所属部门名称", name = "vehicleDepartmentName", required = true)
|
@ApiModelProperty(value = "车辆所属部门名称", name = "vehicleDepartmentName", required = true)
|
||||||
@NotEmpty(message = "车辆所属部门名称不能为空")
|
@NotEmpty(message = "车辆所属部门名称不能为空")
|
||||||
|
|
@ -55,22 +56,24 @@ public class VehicleMessageForCorpAddCmd extends Command {
|
||||||
// @NotEmpty(message = "车辆所属人姓名(员工车辆)不能为空")
|
// @NotEmpty(message = "车辆所属人姓名(员工车辆)不能为空")
|
||||||
private String employeeVehicleUserName;
|
private String employeeVehicleUserName;
|
||||||
@ApiModelProperty(value = "企业ID", name = "corpinfoId", required = true)
|
@ApiModelProperty(value = "企业ID", name = "corpinfoId", required = true)
|
||||||
// @NotEmpty(message = "企业ID不能为空")
|
// @NotNull(message = "企业ID不能为空")
|
||||||
private Long corpId;
|
private Long corpId;
|
||||||
@ApiModelProperty(value = "附件地址", name = "attachmentUrl", required = true)
|
@ApiModelProperty(value = "附件地址", name = "attachmentUrl", required = true)
|
||||||
private String attachmentUrl;
|
private String attachmentUrl;
|
||||||
|
/**
|
||||||
|
* 审批信息
|
||||||
|
*/
|
||||||
@ApiModelProperty(value = "审核人ID", name = "approvalUserId")
|
@ApiModelProperty(value = "审核人ID", name = "approvalUserId")
|
||||||
public Long approvalUserId;
|
public Long approvalUserId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "审核人名字", name = "approvalUserName")
|
@ApiModelProperty(value = "审核人名字", name = "approvalUserName")
|
||||||
public Long approvalUserName;
|
public String approvalUserName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "审核人部门ID", name = "approvalDeptId")
|
@ApiModelProperty(value = "审核人部门ID", name = "approvalDeptId")
|
||||||
public Long approvalDeptId;
|
public Long approvalDeptId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "审核人部门名字", name = "approvalDeptName")
|
@ApiModelProperty(value = "审核人部门名字", name = "approvalDeptName")
|
||||||
public Long approvalDeptName;
|
public String approvalDeptName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public class VehicleAuditLogCO extends ClientObject {
|
||||||
private String vehicleAuditLogId;
|
private String vehicleAuditLogId;
|
||||||
//审批批次(审批全流程,一次申请一次id)
|
//审批批次(审批全流程,一次申请一次id)
|
||||||
@ApiModelProperty(value = "审批批次(审批全流程,一次申请一次id)")
|
@ApiModelProperty(value = "审批批次(审批全流程,一次申请一次id)")
|
||||||
private Long batchId;
|
private String batchId;
|
||||||
//车辆id
|
//车辆id
|
||||||
@ApiModelProperty(value = "车辆id")
|
@ApiModelProperty(value = "车辆id")
|
||||||
private Long vehicleMessageId;
|
private Long vehicleMessageId;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
package com.zcloud.primeport.domain.gateway;
|
package com.zcloud.primeport.domain.gateway;
|
||||||
|
|
||||||
|
|
||||||
import com.zcloud.primeport.domain.model.VehicleAuditLogE;
|
import com.zcloud.primeport.domain.model.VehicleAuditLogE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-domain
|
* web-domain
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ public interface VehicleMessageGateway {
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
Boolean add(VehicleMessageE vehicleMessageE) ;
|
VehicleMessageE add(VehicleMessageE vehicleMessageE) ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
|
|
@ -24,5 +24,7 @@ public interface VehicleMessageGateway {
|
||||||
*/
|
*/
|
||||||
Boolean deletedVehicleMessageById(Long id);
|
Boolean deletedVehicleMessageById(Long id);
|
||||||
Boolean deletedVehicleMessageByIds(Long[] id);
|
Boolean deletedVehicleMessageByIds(Long[] id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.zcloud.primeport.domain.model;
|
||||||
|
|
||||||
import com.alibaba.cola.domain.Entity;
|
import com.alibaba.cola.domain.Entity;
|
||||||
import com.jjb.saas.framework.domain.model.BaseE;
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
|
@ -21,7 +23,7 @@ public class VehicleAuditLogE extends BaseE {
|
||||||
//业务id
|
//业务id
|
||||||
private String vehicleAuditLogId;
|
private String vehicleAuditLogId;
|
||||||
//审批批次(审批全流程,一次申请一次id)
|
//审批批次(审批全流程,一次申请一次id)
|
||||||
private Long batchId;
|
private String batchId;
|
||||||
//车辆id
|
//车辆id
|
||||||
private Long vehicleMessageId;
|
private Long vehicleMessageId;
|
||||||
//审批人id
|
//审批人id
|
||||||
|
|
@ -38,6 +40,28 @@ public class VehicleAuditLogE extends BaseE {
|
||||||
private Integer status;
|
private Integer status;
|
||||||
//审批状态(0正常,1.废除)
|
//审批状态(0正常,1.废除)
|
||||||
private Integer stepType;
|
private Integer stepType;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public Long approvalUserId;
|
||||||
|
public String approvalUserName;
|
||||||
|
public Long approvalDeptId;
|
||||||
|
public String approvalDeptName;
|
||||||
|
|
||||||
|
/** 监管端申请
|
||||||
|
* 申请车辆的时候,审批信息.
|
||||||
|
* @param examTypeE
|
||||||
|
*/
|
||||||
|
public void addFroVehicleLog ( VehicleAuditLogE examTypeE,Long vehicleMessageId) {
|
||||||
|
userId = approvalUserId;
|
||||||
|
userName = approvalUserName;
|
||||||
|
deptId = approvalDeptId;
|
||||||
|
this.deptName = approvalDeptName;
|
||||||
|
this.batchId = "1";
|
||||||
|
this.vehicleMessageId = vehicleMessageId;
|
||||||
|
this.status = 1;
|
||||||
|
stepType = 0;
|
||||||
|
stepSort = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ package com.zcloud.primeport.domain.model;
|
||||||
import com.jjb.saas.framework.domain.model.BaseE;
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
import com.zcloud.gbscommon.utils.DateUtil;
|
import com.zcloud.gbscommon.utils.DateUtil;
|
||||||
import com.zcloud.gbscommon.utils.Tools;
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.tools.Tool;
|
import javax.tools.Tool;
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,12 @@ public class VehicleMessageGatewayImpl implements VehicleMessageGateway {
|
||||||
private final VehicleMessageRepository vehicleMessageRepository;
|
private final VehicleMessageRepository vehicleMessageRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean add(VehicleMessageE vehicleMessageE) {
|
public VehicleMessageE add(VehicleMessageE vehicleMessageE) {
|
||||||
VehicleMessageDO d = new VehicleMessageDO();
|
VehicleMessageDO d = new VehicleMessageDO();
|
||||||
BeanUtils.copyProperties(vehicleMessageE, d);
|
BeanUtils.copyProperties(vehicleMessageE, d);
|
||||||
vehicleMessageRepository.save(d);
|
vehicleMessageRepository.save(d);
|
||||||
return true;
|
BeanUtils.copyProperties( d,vehicleMessageE);
|
||||||
|
return vehicleMessageE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -39,11 +40,7 @@ public class VehicleMessageGatewayImpl implements VehicleMessageGateway {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean deletedVehicleMessageById(Long id) {
|
public Boolean deletedVehicleMessageById(Long id) {
|
||||||
VehicleMessageDO d = new VehicleMessageDO();
|
return vehicleMessageRepository.removeById(id);
|
||||||
d.setId( id);
|
|
||||||
d.setDeleteEnum("TRUE");
|
|
||||||
vehicleMessageRepository.updateById(d);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class VehicleAuditLogDO extends BaseDO {
|
||||||
private String vehicleAuditLogId;
|
private String vehicleAuditLogId;
|
||||||
//审批批次(审批全流程,一次申请一次id)
|
//审批批次(审批全流程,一次申请一次id)
|
||||||
@ApiModelProperty(value = "审批批次(审批全流程,一次申请一次id)")
|
@ApiModelProperty(value = "审批批次(审批全流程,一次申请一次id)")
|
||||||
private Long batchId;
|
private String batchId;
|
||||||
//车辆id
|
//车辆id
|
||||||
@ApiModelProperty(value = "车辆id")
|
@ApiModelProperty(value = "车辆id")
|
||||||
private Long vehicleMessageId;
|
private Long vehicleMessageId;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue