1.口门门禁-审核和审核记录
parent
dcb0643a03
commit
8cb2294b0d
|
|
@ -8,6 +8,7 @@ import com.jjb.saas.framework.auth.model.SSOUser;
|
|||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.primeport.api.VehicleAuditLogServiceI;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogAddCmd;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogApprovalCmd;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogPageQry;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogUpdateCmd;
|
||||
import com.zcloud.primeport.dto.clientobject.VehicleAuditLogCO;
|
||||
|
|
@ -31,50 +32,58 @@ import java.util.ArrayList;
|
|||
public class VehicleAuditLogController {
|
||||
private final VehicleAuditLogServiceI vehicleAuditLogService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<VehicleAuditLogCO> add(@Validated @RequestBody VehicleAuditLogAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return vehicleAuditLogService.add(cmd);
|
||||
}
|
||||
// @ApiOperation("新增")
|
||||
// @PostMapping("/save")
|
||||
// public SingleResponse<VehicleAuditLogCO> add(@Validated @RequestBody VehicleAuditLogAddCmd cmd) {
|
||||
// SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
// return vehicleAuditLogService.add(cmd);
|
||||
// }
|
||||
|
||||
|
||||
// @ApiOperation("所有数据")
|
||||
// @GetMapping("/listAll")
|
||||
// public MultiResponse<VehicleAuditLogCO> listAll() {
|
||||
// return MultiResponse.of(new ArrayList<VehicleAuditLogCO>());
|
||||
// }
|
||||
// @ApiOperation("详情")
|
||||
// @GetMapping("/{id}")
|
||||
// public SingleResponse<VehicleAuditLogCO> getInfoById(@PathVariable("id") Long id) {
|
||||
// return SingleResponse.of(new VehicleAuditLogCO());
|
||||
// }
|
||||
// @ApiOperation("删除")
|
||||
// @DeleteMapping("/{id}")
|
||||
// public Response remove(@PathVariable("id") Long id) {
|
||||
// vehicleAuditLogService.remove(id);
|
||||
// return SingleResponse.buildSuccess();
|
||||
// }
|
||||
// @ApiOperation("删除多个")
|
||||
// @DeleteMapping("/ids")
|
||||
// public Response removeBatch(@RequestParam Long[] ids) {
|
||||
// vehicleAuditLogService.removeBatch(ids);
|
||||
// return SingleResponse.buildSuccess();
|
||||
// }
|
||||
// @ApiOperation("修改")
|
||||
// @PutMapping("/edit")
|
||||
// public SingleResponse edit(@Validated @RequestBody VehicleAuditLogUpdateCmd vehicleAuditLogUpdateCmd) {
|
||||
// vehicleAuditLogService.edit(vehicleAuditLogUpdateCmd);
|
||||
// return SingleResponse.buildSuccess();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 审批通过/不通过
|
||||
* @param auditLogApprovalCmd
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("通过/不通过")
|
||||
@PutMapping("/approval")
|
||||
public SingleResponse approval(@Validated @RequestBody VehicleAuditLogApprovalCmd auditLogApprovalCmd) {
|
||||
vehicleAuditLogService.approval(auditLogApprovalCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<VehicleAuditLogCO> page(@RequestBody VehicleAuditLogPageQry qry) {
|
||||
return vehicleAuditLogService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@GetMapping("/listAll")
|
||||
public MultiResponse<VehicleAuditLogCO> listAll() {
|
||||
return MultiResponse.of(new ArrayList<VehicleAuditLogCO>());
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<VehicleAuditLogCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new VehicleAuditLogCO());
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public Response remove(@PathVariable("id") Long id) {
|
||||
vehicleAuditLogService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除多个")
|
||||
@DeleteMapping("/ids")
|
||||
public Response removeBatch(@RequestParam Long[] ids) {
|
||||
vehicleAuditLogService.removeBatch(ids);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody VehicleAuditLogUpdateCmd vehicleAuditLogUpdateCmd) {
|
||||
vehicleAuditLogService.edit(vehicleAuditLogUpdateCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.zcloud.primeport.command;
|
|||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.primeport.domain.gateway.VehicleAuditLogGateway;
|
||||
import com.zcloud.primeport.domain.model.VehicleAuditLogE;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogApprovalCmd;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -30,5 +31,30 @@ public class VehicleAuditLogUpdateExe {
|
|||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批功能
|
||||
* @param auditLogApprovalCmd
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(VehicleAuditLogApprovalCmd auditLogApprovalCmd) {
|
||||
boolean res = false;
|
||||
VehicleAuditLogE approval = new VehicleAuditLogE();
|
||||
VehicleAuditLogE vehicleAuditLogE = vehicleAuditLogGateway.queryVehicleAuditLogByVehicleMessageId(auditLogApprovalCmd.getVehicleMessageId()); //找到这个车辆未审批通过的记录
|
||||
if (vehicleAuditLogE == null){
|
||||
throw new BizException("未找到车辆审批记录!");
|
||||
}
|
||||
if (vehicleAuditLogE.getStatus() == 2){ //2通过
|
||||
approval = approval.approvalTongguo(vehicleAuditLogE.getId());
|
||||
}else if (vehicleAuditLogE.getStatus() == 3){ //3不通过
|
||||
approval = approval.approvalNoTongguo(vehicleAuditLogE.getId(),auditLogApprovalCmd.getComments());
|
||||
}else if (vehicleAuditLogE.getStatus() == 1){
|
||||
throw new BizException("车辆已审批通过!");
|
||||
}
|
||||
res = vehicleAuditLogGateway.update(approval);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.zcloud.primeport.command.VehicleAuditLogRemoveExe;
|
|||
import com.zcloud.primeport.command.VehicleAuditLogUpdateExe;
|
||||
import com.zcloud.primeport.command.query.VehicleAuditLogQueryExe;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogAddCmd;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogApprovalCmd;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogPageQry;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogUpdateCmd;
|
||||
import com.zcloud.primeport.dto.clientobject.VehicleAuditLogCO;
|
||||
|
|
@ -54,5 +55,14 @@ public class VehicleAuditLogServiceImpl implements VehicleAuditLogServiceI {
|
|||
public void removeBatch(Long[] ids) {
|
||||
vehicleAuditLogRemoveExe.execute(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批车辆信息,通过/不通过
|
||||
* @param auditLogApprovalCmd
|
||||
*/
|
||||
@Override
|
||||
public void approval(VehicleAuditLogApprovalCmd auditLogApprovalCmd) {
|
||||
vehicleAuditLogUpdateExe.execute(auditLogApprovalCmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.zcloud.primeport.api;
|
|||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogAddCmd;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogApprovalCmd;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogPageQry;
|
||||
import com.zcloud.primeport.dto.VehicleAuditLogUpdateCmd;
|
||||
import com.zcloud.primeport.dto.clientobject.VehicleAuditLogCO;
|
||||
|
|
@ -22,5 +23,7 @@ public interface VehicleAuditLogServiceI {
|
|||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
|
||||
void approval(VehicleAuditLogApprovalCmd auditLogApprovalCmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ public class VehicleAuditLogAddCmd extends Command {
|
|||
@ApiModelProperty(value = "审批状态(0正常,1.废除)", name = "stepType", required = true)
|
||||
@NotEmpty(message = "审批状态(0正常,1.废除)不能为空")
|
||||
private Integer stepType;
|
||||
|
||||
@ApiModelProperty(value = "驳回备注", name = "comments", required = true)
|
||||
@NotEmpty(message = "驳回备注不能为空")
|
||||
private String comments;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author guoyuepeng
|
||||
* @Date 2025-11-18 14:07:47
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleAuditLogApprovalCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "车辆id", name = "vehicleMessageId", required = true)
|
||||
@NotEmpty(message = "车辆id不能为空")
|
||||
private Long vehicleMessageId;
|
||||
|
||||
@ApiModelProperty(value = "审批人id", name = "userId", required = true)
|
||||
@NotEmpty(message = "审批人id不能为空")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "审批状态(1未开始.2通过.3不通过)", name = "status", required = true)
|
||||
@NotEmpty(message = "审批状态(1未开始.2通过.3不通过)不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "驳回备注", name = "comments", required = true)
|
||||
private String comments;
|
||||
}
|
||||
|
||||
|
|
@ -23,6 +23,8 @@ public class VehicleAuditLogPageQry extends PageQuery {
|
|||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeVehicleAuditLogId;
|
||||
|
||||
@ApiModelProperty("车辆ID")
|
||||
private String eqVehicleMessageId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ public class VehicleAuditLogUpdateCmd extends Command {
|
|||
@ApiModelProperty(value = "审批状态(0正常,1.废除)", name = "stepType", required = true)
|
||||
@NotEmpty(message = "审批状态(0正常,1.废除)不能为空")
|
||||
private Integer stepType;
|
||||
|
||||
@ApiModelProperty(value = "驳回备注", name = "comments", required = true)
|
||||
@NotEmpty(message = "驳回备注不能为空")
|
||||
private String comments;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ public class VehicleAuditLogCO extends ClientObject {
|
|||
//审批状态(0正常,1.废除)
|
||||
@ApiModelProperty(value = "审批状态(0正常,1.废除)")
|
||||
private Integer stepType;
|
||||
|
||||
//驳回备注
|
||||
@ApiModelProperty(value = "驳回备注")
|
||||
private String comments;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,5 +24,9 @@ public interface VehicleAuditLogGateway {
|
|||
Boolean deletedVehicleAuditLogById(Long id);
|
||||
|
||||
Boolean deletedVehicleAuditLogByIds(Long[] id);
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
VehicleAuditLogE queryVehicleAuditLogByVehicleMessageId(Long vehicleMessageId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public class VehicleAuditLogE extends BaseE {
|
|||
private Integer status;
|
||||
//审批状态(0正常,1.废除)
|
||||
private Integer stepType;
|
||||
//驳回备注
|
||||
private String comments;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
@ -66,5 +68,18 @@ public class VehicleAuditLogE extends BaseE {
|
|||
this.stepType = 0; //审批状态(0正常,1.废除)
|
||||
this.stepSort = 1; //审批步骤排序
|
||||
}
|
||||
|
||||
|
||||
public VehicleAuditLogE approvalTongguo (Long id) {
|
||||
this.id = id;
|
||||
this.status = 2;
|
||||
return this;
|
||||
}
|
||||
public VehicleAuditLogE approvalNoTongguo (Long id, String comments) {
|
||||
this.id = id;
|
||||
this.status = 3;
|
||||
this.comments = comments;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,5 +46,15 @@ public class VehicleAuditLogGatewayImpl implements VehicleAuditLogGateway {
|
|||
public Boolean deletedVehicleAuditLogByIds(Long[] ids) {
|
||||
return vehicleAuditLogRepository.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VehicleAuditLogE queryVehicleAuditLogByVehicleMessageId(Long vehicleMessageId) {
|
||||
VehicleAuditLogE vehicleAuditLogE = new VehicleAuditLogE();
|
||||
VehicleAuditLogDO byVehicleMessageId = vehicleAuditLogRepository.getOne(vehicleAuditLogRepository.lambdaQuery()
|
||||
.eq(VehicleAuditLogDO::getVehicleMessageId, vehicleMessageId)
|
||||
.eq(VehicleAuditLogDO::getStatus, 1));
|
||||
BeanUtils.copyProperties(byVehicleMessageId, vehicleAuditLogE);
|
||||
return vehicleAuditLogE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@ public class VehicleAuditLogDO extends BaseDO {
|
|||
//审批状态(0正常,1.废除)
|
||||
@ApiModelProperty(value = "审批状态(0正常,1.废除)")
|
||||
private Integer stepType;
|
||||
|
||||
//驳回备注
|
||||
@ApiModelProperty(value = "驳回备注")
|
||||
private String comments;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue