feat:封闭车辆的申请与分页

koumen
dearLin 2026-03-20 11:21:07 +08:00
parent 6a4e893873
commit 95f9fba705
10 changed files with 113 additions and 18 deletions

View File

@ -1,10 +1,19 @@
package com.zcloud.primeport.command;
import com.alibaba.cola.dto.SingleResponse;
import com.jjb.saas.framework.auth.model.SSOUser;
import com.jjb.saas.framework.auth.utils.AuthContext;
import com.zcloud.gbscommon.zclouduser.facade.ZcloudUserFacade;
import com.zcloud.gbscommon.zclouduser.response.ZcloudUserCo;
import com.zcloud.primeport.domain.enums.AuditEnum;
import com.zcloud.primeport.domain.enums.CloseCarBelongTypeEnum;
import com.zcloud.primeport.domain.gateway.ClosedAreaCarApplyGateway;
import com.zcloud.primeport.domain.model.ClosedAreaCarApplyE;
import com.zcloud.primeport.dto.ClosedAreaCarApplyAddCmd;
import com.alibaba.cola.exception.BizException;
import jodd.util.Base64;
import lombok.AllArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -20,11 +29,34 @@ import org.springframework.transaction.annotation.Transactional;
@AllArgsConstructor
public class ClosedAreaCarApplyAddExe {
private final ClosedAreaCarApplyGateway closedAreaCarApplyGateway;
@DubboReference
private ZcloudUserFacade zcloudUserFacade;
@Transactional(rollbackFor = Exception.class)
public boolean execute(ClosedAreaCarApplyAddCmd cmd) {
ClosedAreaCarApplyE closedAreaCarApplyE = new ClosedAreaCarApplyE();
BeanUtils.copyProperties(cmd, closedAreaCarApplyE);
closedAreaCarApplyE.setAuditFlag(AuditEnum.WAITING.getCode());
if (!cmd.getCarBelongType().equals(CloseCarBelongTypeEnum.TEMPORARY_VEHICLES.getCode())) {
SingleResponse<ZcloudUserCo> infoByUserId = zcloudUserFacade.getInfoByUserId(AuthContext.getUserId());
ZcloudUserCo userData = infoByUserId.getData();
SSOUser currentUser = AuthContext.getCurrentUser();
if (cmd.getCarBelongType().equals(CloseCarBelongTypeEnum.FGS_INSIDE_VEHICLES.getCode())) {
closedAreaCarApplyE.setJurisdictionalCorpId(currentUser.getTenantId());
closedAreaCarApplyE.setJurisdictionalCorpName(currentUser.getTenantName());
}
closedAreaCarApplyE.setApplyPersonCorpId(currentUser.getTenantId());
closedAreaCarApplyE.setApplyPersonCorpName(currentUser.getTenantName());
closedAreaCarApplyE.setApplyPersonDepartmentId(currentUser.getOrgId());
closedAreaCarApplyE.setApplyPersonDepartmentName(currentUser.getOrgName());
closedAreaCarApplyE.setApplyPersonUserId(currentUser.getUserId());
closedAreaCarApplyE.setApplyPersonUserName(userData.getName());
closedAreaCarApplyE.setUserPhone(userData.getPhone());
closedAreaCarApplyE.setUserCard(userData.getUserIdCard());
closedAreaCarApplyE.setUserFaceUrl(userData.getUserAvatarUrl());
} else {
closedAreaCarApplyE.setUserCard(Base64.encodeToString(cmd.getUserCard()));
}
boolean res = false;
try {
res = closedAreaCarApplyGateway.add(closedAreaCarApplyE);

View File

@ -1,6 +1,7 @@
package com.zcloud.primeport.command;
import com.alibaba.cola.dto.SingleResponse;
import com.jjb.saas.framework.auth.model.SSOUser;
import com.jjb.saas.framework.auth.utils.AuthContext;
import com.zcloud.gbscommon.zclouduser.facade.ZcloudUserFacade;
import com.zcloud.gbscommon.zclouduser.response.ZcloudUserCo;
@ -37,6 +38,13 @@ public class ClosedAreaPersonApplyAddExe {
if (!cmd.getPersonBelongType().equals(4)) {
SingleResponse<ZcloudUserCo> infoByUserId = zcloudUserFacade.getInfoByUserId(AuthContext.getUserId());
ZcloudUserCo userData = infoByUserId.getData();
SSOUser currentUser = AuthContext.getCurrentUser();
closedAreaPersonApplyE.setApplyPersonCorpId(currentUser.getTenantId());
closedAreaPersonApplyE.setApplyPersonCorpName(currentUser.getTenantName());
closedAreaPersonApplyE.setApplyPersonDepartmentId(currentUser.getOrgId());
closedAreaPersonApplyE.setApplyPersonDepartmentName(currentUser.getOrgName());
closedAreaPersonApplyE.setApplyPersonUserId(currentUser.getUserId());
closedAreaPersonApplyE.setApplyPersonUserName(userData.getName());
closedAreaPersonApplyE.setUserPhone(userData.getPhone());
closedAreaPersonApplyE.setUserCard(userData.getUserIdCard());
closedAreaPersonApplyE.setUserFaceUrl(userData.getUserAvatarUrl());

View File

@ -47,10 +47,8 @@ public class ClosedAreaCarApplyQueryExe {
Map<String, Object> params = PageQueryHelper.toHashMap(closedAreaCarApplyPageQry);
PageResponse<ClosedAreaCarApplyDO> pageResponse = closedAreaCarApplyRepository.listPage(params);
List<ClosedAreaCarApplyCO> examCenterCOS = closedAreaCarApplyCoConvertor.converDOsToCOs(pageResponse.getData());
// 获取当前登录用户ID
Long currentUserId = AuthContext.getUserId();
// 设置当前用户是否能审核
for (ClosedAreaCarApplyCO co : examCenterCOS) {
// 审核中(1)且当前用户是审批人 → 能审核(1),否则不能审核(2)
@ -62,7 +60,6 @@ public class ClosedAreaCarApplyQueryExe {
co.setCurrentUserCanAudit(2);
}
}
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
}
}

View File

@ -20,9 +20,9 @@ import javax.validation.constraints.*;
@NoArgsConstructor
@AllArgsConstructor
public class ClosedAreaCarApplyAddCmd extends Command {
@ApiModelProperty(value = "申请归属1股份2分公司3相关方4临时人员", name = "personBelongType", required = true)
@ApiModelProperty(value = "申请归属1股份2分公司3相关方4临时人员5分公司内部车辆", name = "carBelongType", required = true)
@NotNull(message = "申请归属1股份2分公司3相关方4临时人员不能为空")
private Integer personBelongType;
private Integer carBelongType;
@ApiModelProperty(value = "车牌类型数据字典", name = "licenceType", required = true)
@NotEmpty(message = "车牌类型数据字典不能为空")
@ -130,5 +130,34 @@ public class ClosedAreaCarApplyAddCmd extends Command {
private String auditPersonUserName;
//申请人员所属企业ID
@ApiModelProperty(value = "申请人员所属企业ID", name = "applyPersonCorpId", required = true)
private Long applyPersonCorpId;
//申请人员所属企业名称
@ApiModelProperty(value = "申请人员所属企业名称", name = "applyPersonCorpName", required = true)
private String applyPersonCorpName;
//待审批人员所属部门id
@ApiModelProperty(value = "待审批人员所属部门id", name = "applyPersonDepartmentId", required = true)
private Long applyPersonDepartmentId;
//申请人员部门名称
@ApiModelProperty(value = "申请人员部门名称", name = "applyPersonDepartmentName", required = true)
private String applyPersonDepartmentName;
//申请人员id
@ApiModelProperty(value = "申请人员id", name = "applyPersonUserId", required = true)
private Long applyPersonUserId;
//申请人员姓名
@ApiModelProperty(value = "申请人员姓名", name = "applyPersonUserName", required = true)
private String applyPersonUserName;
//申请人头像
@ApiModelProperty(value = "申请人头像", name = "userFaceUrl", required = true)
private String userFaceUrl;
//申请人手机号
@ApiModelProperty(value = "申请人手机号", name = "userPhone", required = true)
private String userPhone;
//申请人身份证号码
@ApiModelProperty(value = "申请人身份证号码", name = "userCard", required = true)
private String userCard;
}

View File

@ -24,13 +24,15 @@ public class ClosedAreaCarApplyPageQry extends PageQuery {
* - `le`:
* - `ne`: SQL!=
*/
@ApiModelProperty(value = "车牌号", name = "licenceLo", required = true)
@ApiModelProperty(value = "车牌号", name = "licenceLo")
private String licenceLo;
@ApiModelProperty(value = "1申请中2已审批", name = "applyPersonUserName", required = true)
@ApiModelProperty(value = "申请人姓名", name = "applyPersonUserName")
private String applyPersonUserName;
@ApiModelProperty(value = "1查本单位申请中本人待审批的数据传入这个2查已审批本单位的申请记录的数据传入这个", name = "processOrRecord", required = true)
@ApiModelProperty(value = "审核状态(1:审核中;2审核通过; 3审核驳回)", name = "auditFlag")
private Integer auditFlag;
@ApiModelProperty(value = "1查本单位申请中本人待审批的数据传入这个2查已审批本单位的申请记录的数据传入这个", name = "processOrRecord")
private Integer processOrRecord;
@ApiModelProperty(value = "1股份2分公司3相关方4临时人员", name = "personBelongType", required = true)
private Integer personBelongType;
@ApiModelProperty(value = "1股份2分公司3相关方4临时人员", name = "carBelongType")
private Integer carBelongType;
}

View File

@ -22,8 +22,8 @@ public class ClosedAreaCarApplyCO extends ClientObject {
@ApiModelProperty(value = "主键")
private Long id;
//申请归属1股份2分公司3相关方4临时人员
@ApiModelProperty(value = "申请归属1股份2分公司3相关方4临时人员")
private Integer personBelongType;
@ApiModelProperty(value = "申请归属1股份2分公司3相关方4临时人员5分公司内部车辆")
private Integer carBelongType;
//车牌类型数据字典
@ApiModelProperty(value = "车牌类型数据字典")
private String licenceType;

View File

@ -0,0 +1,24 @@
package com.zcloud.primeport.domain.enums;
public enum CloseCarBelongTypeEnum {
JGD_VEHICLES(1, "股份申请车辆入场"),
FGS_VEHICLES(2, "分公司申请车辆入场"),
XGF_VEHICLES(3, "相关方单位车辆"),
TEMPORARY_VEHICLES(4, "临时车辆"),
FGS_INSIDE_VEHICLES(5, "分公司内部车辆");
private Integer code;
private String desc;
CloseCarBelongTypeEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

View File

@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
@Data
public class ClosedAreaCarApplyE extends BaseE {
//申请归属1股份2分公司3相关方4临时人员
private Integer personBelongType;
private Integer carBelongType;
//车牌类型数据字典
private String licenceType;
//车牌类型名称0-白牌 1- 蓝牌 2-黄牌 3-绿牌 4-黑牌
@ -43,10 +43,6 @@ public class ClosedAreaCarApplyE extends BaseE {
private Long jurisdictionalCorpId;
//区域管辖单位名称
private String jurisdictionalCorpName;
//项目id
private Long projectId;
//项目名称
private String projectName;
//申请人员所属企业ID
private Long applyPersonCorpId;
//申请人员所属企业名称
@ -68,6 +64,10 @@ public class ClosedAreaCarApplyE extends BaseE {
//申请人身份证号码
private String userCard;
//随行人员
//项目id
private Long projectId;
//项目名称
private String projectName;
private String entourage;
//告知签字
private Long informSignId;

View File

@ -20,7 +20,7 @@ import lombok.NoArgsConstructor;
public class ClosedAreaCarApplyDO extends BaseDO {
//申请归属1股份2分公司3相关方4临时人员
@ApiModelProperty(value = "申请归属1股份2分公司3相关方4临时人员")
private Integer personBelongType;
private Integer carBelongType;
//车牌类型数据字典
@ApiModelProperty(value = "车牌类型数据字典")
private String licenceType;

View File

@ -15,6 +15,9 @@
AND c.audit_flag != 1
</if>
</if>
<if test="params.auditFlag != null">
AND c.audit_flag = #{params.auditFlag}
</if>
<if test="params.applyPersonUserName != null and params.applyPersonUserName != ''">
AND c.apply_person_user_name like CONCAT('%', #{params.applyPersonUserName}, '%')
</if>