@@ -30,10 +30,10 @@ public class ReleasePlateApplyRequest extends AbstractSignTypeRequest<ReleasePla | |||
} | |||
// private String wxOpenId;//微信小程序openId | |||
private Integer isSelf;//是否本人 1是,2否 | |||
@NotNull | |||
@IntegerConstant(values="1,2") | |||
private Integer applyType;//申请车辆分类:1个人,2单位 | |||
// private Integer isSelf;//是否本人 1是,2否 | |||
// @NotNull | |||
// @IntegerConstant(values="1,2") | |||
// private Integer applyType;//申请车辆分类:1个人,2单位 | |||
@NotBlank | |||
@VehiclePlate | |||
private String vehiclePlate;//车牌号 | |||
@@ -66,6 +66,10 @@ public class ReleasePlateApplyRequest extends AbstractSignTypeRequest<ReleasePla | |||
private Integer unitIdType;//单位证件类型 | |||
private String unitId;//单位证件编号 | |||
@EnumInteger(enumClazz = IdType.class, message = "用户证件类型不合规") | |||
@IntegerConstant(values = "101,203") | |||
private Integer ownerIdType;// 车主证件类型 | |||
private String ownerName;////非本人办理,车主名称 | |||
private String ownerIdNum;//非本人办理,车主证件号 | |||
private String ownerPosImgUrl;//非本人办理,车主身份证件人面地址 | |||
@@ -84,17 +88,32 @@ public class ReleasePlateApplyRequest extends AbstractSignTypeRequest<ReleasePla | |||
public void relatedValid(ErrorMsgBuilder builder) { | |||
builder.validFieldTrue("sourceType", sourceType == SourceType.ALI || sourceType == SourceType.WECHAT || sourceType == SourceType.WEB || sourceType == SourceType.SERVICE_HALL, "申请来源不正确"); | |||
if (applyType == 2){ | |||
builder.validFieldNotBlank("unitName",unitName); | |||
builder.validFieldNotNull("unitIdType",unitIdType); | |||
builder.validFieldNotBlank("unitId",unitId); | |||
builder.validFieldNotBlank("unitImagesUrl",unitImagesUrl); | |||
// if (applyType == 2){ | |||
// builder.validFieldNotBlank("unitName",unitName); | |||
// builder.validFieldNotNull("unitIdType",unitIdType); | |||
// builder.validFieldNotBlank("unitId",unitId); | |||
// builder.validFieldNotBlank("unitImagesUrl",unitImagesUrl); | |||
// builder.validFieldNotBlank("proxyUrl",proxyUrl); | |||
// } | |||
// //个人 | |||
// if (applyType == 1){ | |||
// builder.validFieldNotNull("isSelf",isSelf); | |||
// if (isSelf == 2) { | |||
// builder.validFieldNotBlank("ownerName", ownerName); | |||
// builder.validFieldNotBlank("ownerIdNum", ownerIdNum); | |||
// builder.validFieldNotBlank("ownerPosImgUrl", ownerPosImgUrl); | |||
// builder.validFieldNotBlank("ownerNegImgUrl", ownerNegImgUrl); | |||
// } | |||
// } | |||
if (ownerIdType != null){ | |||
builder.validFieldNotBlank("proxyUrl",proxyUrl); | |||
} | |||
//个人 | |||
if (applyType == 1){ | |||
builder.validFieldNotNull("isSelf",isSelf); | |||
if (isSelf == 2) { | |||
if (ownerIdType == 101) { | |||
builder.validFieldNotBlank("unitName", unitName); | |||
builder.validFieldNotNull("unitIdType", unitIdType); | |||
builder.validFieldNotBlank("unitId", unitId); | |||
builder.validFieldNotBlank("unitImagesUrl", unitImagesUrl); | |||
}else { | |||
builder.validFieldNotBlank("ownerName", ownerName); | |||
builder.validFieldNotBlank("ownerIdNum", ownerIdNum); | |||
builder.validFieldNotBlank("ownerPosImgUrl", ownerPosImgUrl); |
@@ -5,12 +5,15 @@ import cn.com.taiji.core.model.comm.protocol.valid.ErrorMsgBuilder; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
public class IssueOrderConsigneeRequest extends AbstractSignTypeRequest<IssueOrderConsigneeResponse> { | |||
private String orgCode; | |||
private String onlineOrderNo; | |||
private String cardId; | |||
@NotBlank | |||
private String obuId; | |||
private String trackingNumber; | |||
private String courierCompany; |
@@ -34,9 +34,9 @@ public class ReleasePlateController extends MyValidController { | |||
@ApiOperation("订单申请") | |||
@PostMapping("/apply") | |||
public ApiResponse<Void> apply(@Validated @RequestBody RealsePlateRequestDTO req) throws ManagerException { | |||
releasePlateManager.apply(req); | |||
return ApiResponse.success(); | |||
public ApiResponse<RealsePlateResponseDTO> apply(@Validated @RequestBody RealsePlateRequestDTO req) throws ManagerException { | |||
RealsePlateResponseDTO responseDTO = releasePlateManager.apply(req); | |||
return ApiResponse.of(responseDTO); | |||
} | |||
//用户查询、列表 |
@@ -26,12 +26,12 @@ public class RealsePlateRequestDTO extends AbstractBizRequestDTO { | |||
// @ApiModelProperty(value = "微信小程序openId") | |||
// private String wxOpenId; | |||
@ApiModelProperty(value = "是否本人 1是,2否", required = true) | |||
private Integer isSelf; | |||
@ApiModelProperty(value = "申请车辆分类:1个人,2单位", required = true) | |||
@NotNull | |||
@IntegerConstant(values="1,2") | |||
private Integer applyType; | |||
// @ApiModelProperty(value = "是否本人 1是,2否", required = true) | |||
// private Integer isSelf; | |||
// @ApiModelProperty(value = "申请车辆分类:1个人,2单位", required = true) | |||
// @NotNull | |||
// @IntegerConstant(values="1,2") | |||
// private Integer applyType; | |||
@ApiModelProperty(value = "车牌号", required = true) | |||
@NotBlank | |||
// @VehicleId | |||
@@ -78,6 +78,11 @@ public class RealsePlateRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "单位证件编号") | |||
private String unitId;//单位证件编号 | |||
@EnumInteger(enumClazz = IdType.class, message = "用户证件类型不合规") | |||
@ApiModelProperty(value = "车主证件类型,不需要上传车主信息不要传值") | |||
@IntegerConstant(values = "101,203") | |||
private Integer ownerIdType;// 车主证件类型 | |||
@ApiModelProperty(value = "车主姓名")//非本人办理,车主名称 | |||
private String ownerName; | |||
@ApiModelProperty(value = "车主证件号")//非本人办理,车主证件号 | |||
@@ -96,22 +101,38 @@ public class RealsePlateRequestDTO extends AbstractBizRequestDTO { | |||
protected void validate(ViolationValidator validator) { | |||
super.validate(validator); | |||
validator.validField("sourceType", !(getOrderSource() == SourceType.ALI || getOrderSource() == SourceType.WECHAT || getOrderSource() == SourceType.WEB || getOrderSource() == SourceType.SERVICE_HALL), "申请来源不正确"); | |||
if (applyType == 2){ | |||
// if (applyType == 2){ | |||
// validator.validFieldNotBlank("unitName",unitName); | |||
// validator.validFieldNotNull("unitIdType",unitIdType); | |||
// validator.validFieldNotBlank("unitId",unitId); | |||
// validator.validFieldNotBlank("unitImagesUrl",unitImagesUrl); | |||
// validator.validFieldNotBlank("proxyUrl",proxyUrl); | |||
// } | |||
// //个人 | |||
// if (applyType == 1 && isSelf == 2){ | |||
// validator.validFieldNotNull("isSelf",isSelf); | |||
// if (isSelf == 2) { | |||
// validator.validFieldNotBlank("ownerName", ownerName); | |||
// validator.validFieldNotBlank("ownerIdNum", ownerIdNum); | |||
// validator.validFieldNotBlank("ownerPosImgUrl", ownerPosImgUrl); | |||
// validator.validFieldNotBlank("ownerNegImgUrl", ownerNegImgUrl); | |||
// } | |||
// } | |||
} | |||
//车主校验 | |||
public void validate1(ViolationValidator validator) { | |||
validator.validFieldNotBlank("proxyUrl",proxyUrl); | |||
if (ownerIdType == 101){ | |||
validator.validFieldNotBlank("ownerName", ownerName); | |||
validator.validFieldNotBlank("ownerIdNum", ownerIdNum); | |||
validator.validFieldNotBlank("ownerPosImgUrl", ownerPosImgUrl); | |||
validator.validFieldNotBlank("ownerNegImgUrl", ownerNegImgUrl); | |||
}else { | |||
validator.validFieldNotBlank("unitName",unitName); | |||
validator.validFieldNotNull("unitIdType",unitIdType); | |||
validator.validFieldNotBlank("unitId",unitId); | |||
validator.validFieldNotBlank("unitImagesUrl",unitImagesUrl); | |||
validator.validFieldNotBlank("proxyUrl",proxyUrl); | |||
} | |||
//个人 | |||
if (applyType == 1 && isSelf == 2){ | |||
validator.validFieldNotNull("isSelf",isSelf); | |||
if (isSelf == 2) { | |||
validator.validFieldNotBlank("ownerName", ownerName); | |||
validator.validFieldNotBlank("ownerIdNum", ownerIdNum); | |||
validator.validFieldNotBlank("ownerPosImgUrl", ownerPosImgUrl); | |||
validator.validFieldNotBlank("ownerNegImgUrl", ownerNegImgUrl); | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
package cn.com.taiji.iaw.dto.ass; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/8/28 20:56 | |||
* @Filename:RealsePlateResponseDTO | |||
* @description: | |||
*/ | |||
@Data | |||
@ApiModel(description = "解除车牌占用申请响应参数") | |||
public class RealsePlateResponseDTO { | |||
@ApiModelProperty(value = "上传车主身份标识,1需要,2不需要") | |||
private Integer flag; | |||
} |
@@ -5,6 +5,7 @@ import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ass.PlateOccupyQueryRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ass.PlateOccupyQueryResponse; | |||
import cn.com.taiji.iaw.dto.ass.RealsePlateRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.RealsePlateResponseDTO; | |||
import cn.com.taiji.iaw.dto.ass.releasePlate.*; | |||
/** | |||
@@ -14,7 +15,7 @@ import cn.com.taiji.iaw.dto.ass.releasePlate.*; | |||
* @description: | |||
*/ | |||
public interface ReleasePlateManager { | |||
void apply(RealsePlateRequestDTO req) throws ManagerException; | |||
RealsePlateResponseDTO apply(RealsePlateRequestDTO req) throws ManagerException; | |||
PlateOccupyQueryResponse occupyQuery(PlateOccupyQueryRequest req) throws ManagerException; | |||
@@ -2,10 +2,12 @@ package cn.com.taiji.iaw.manager.ass; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.valid.ViolationValidator; | |||
import cn.com.taiji.core.entity.ass.AssOrderinfo; | |||
import cn.com.taiji.core.entity.ass.AssVehicleRelieve; | |||
import cn.com.taiji.core.entity.dict.ass.AssOrderType; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import cn.com.taiji.core.entity.dict.basic.UserType; | |||
import cn.com.taiji.core.entity.dict.log.OperateType; | |||
import cn.com.taiji.core.entity.user.Staff; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ass.*; | |||
@@ -14,6 +16,7 @@ import cn.com.taiji.core.repo.jpa.ass.AssVehicleRelieveRepo; | |||
import cn.com.taiji.core.repo.jpa.user.StaffRepo; | |||
import cn.com.taiji.iaw.dto.ass.AssOrderInfoResponseDTO; | |||
import cn.com.taiji.iaw.dto.ass.RealsePlateRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.RealsePlateResponseDTO; | |||
import cn.com.taiji.iaw.dto.ass.releasePlate.*; | |||
import cn.com.taiji.iaw.manager.AbstractIawManager; | |||
import cn.com.taiji.iaw.model.ass.releasePlate.*; | |||
@@ -41,8 +44,20 @@ public class ReleasePlateManagerImpl extends AbstractIawManager implements Relea | |||
@Autowired | |||
private AssVehicleRelieveRepo assVehicleRelieveRepo; | |||
@Override | |||
public void apply(RealsePlateRequestDTO req) throws ManagerException { | |||
public RealsePlateResponseDTO apply(RealsePlateRequestDTO req) throws ManagerException { | |||
req.validate(); | |||
RealsePlateResponseDTO responseDTO = new RealsePlateResponseDTO(); | |||
if (!req.getOwnerName().equals(req.getName()) && req.getOwnerIdType() == null){ | |||
responseDTO.setFlag(1); | |||
return responseDTO; | |||
} | |||
if (req.getOwnerIdType() != null) { | |||
//格式校验 | |||
ViolationValidator validator = new ViolationValidator(); | |||
req.validate1(validator);//校验授权书 | |||
validator.checkErrors(); | |||
} | |||
ReleasePlateApplyRequest request = copyProperties(req, new ReleasePlateApplyRequest()); | |||
request.setSourceType(req.getOrderSource()); | |||
String openId = findOpenIdByToken(req.getAccessToken()); | |||
@@ -59,6 +74,7 @@ public class ReleasePlateManagerImpl extends AbstractIawManager implements Relea | |||
} | |||
ReleasePlateApplyResponse response = jsonPostRepeat(request); | |||
sysPersistOperateLog(OperateType.RELEASE_PLATE_APPLY, response.getId(), req.getOrderSource(), openId,"解除车牌占用申请"); | |||
return null; | |||
} | |||
@Override | |||
@@ -115,7 +131,7 @@ public class ReleasePlateManagerImpl extends AbstractIawManager implements Relea | |||
ReleasePlateViewResponse response = jsonPostRepeat(request); | |||
ReleasePlateViewResponseDTO responseDTO = new ReleasePlateViewResponseDTO(); | |||
copyProperties(response, responseDTO); | |||
copyProperties(response, responseDTO);//复制卡签信息及黑名单信息 | |||
AssOrderinfo assOrderinfo = response.getAssOrderinfo(); | |||
AssVehicleRelieve vehicleRelieve = response.getVehicleRelieve(); | |||
ResultInfo resultInfo = getInfo(vehicleRelieve, assOrderinfo); |
@@ -66,16 +66,18 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
@Override | |||
protected void businessValidateInternal(ErrorMsgBuilder builder, ReleasePlateApplyRequest req, ServiceLogEvent event, Map<String, Object> dataStream) throws ServiceHandleException { | |||
if (req.getApplyType() == 1) { | |||
//个人申请 | |||
if (req.getIsSelf() == 1 && !req.getName().equals(req.getVehicleOwnerName())) { | |||
throw newBusinessException("车主信息不符,请重新申请"); | |||
}else if (req.getIsSelf() == 2 && !req.getOwnerName().equals(req.getVehicleOwnerName())){ | |||
throw newBusinessException("车主信息不符,请重新申请"); | |||
if (req.getOwnerIdType() == null && !req.getName().equals(req.getVehicleOwnerName())) { | |||
throw newBusinessException("行驶证和申请人信息不符,请重新申请"); | |||
}else { | |||
if (req.getOwnerIdType() == 101) {//个人 | |||
if (!req.getOwnerName().equals(req.getVehicleOwnerName())) { | |||
throw newBusinessException("车主信息不符,请重新申请"); | |||
} | |||
}else {//单位 | |||
if (!req.getUnitName().equals(req.getVehicleOwnerName())) { | |||
throw newBusinessException("行驶证和营业执照车主不符,请重新申请"); | |||
} | |||
} | |||
} else if (!req.getUnitName().equals(req.getVehicleOwnerName())){ | |||
//单位申请 | |||
throw newBusinessException("行驶证和营业执照车主不符,请重新申请"); | |||
} | |||
String vehicleId = req.getVehiclePlate() + "_" + req.getVehiclePlateColor(); | |||
@@ -233,18 +235,19 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
assVehicleRelieve.setVehicleOwnerName(req.getVehicleOwnerName()); | |||
assVehicleRelieve.setVehNegImgUrl(req.getVehNegImgUrl()); | |||
assVehicleRelieve.setRelieveStatus(RelieveStatus.UNHANDLED); | |||
if (req.getApplyType() == 2) { | |||
assVehicleRelieve.setUnitImagesUrl(req.getUnitImagesUrl()); | |||
assVehicleRelieve.setProxyUrl(req.getProxyUrl()); | |||
assVehicleRelieve.setUnitIdType(IdType.YYZZ); | |||
assVehicleRelieve.setUnitName(req.getUnitName()); | |||
assVehicleRelieve.setUnitId(req.getUnitId()); | |||
} | |||
if (req.getApplyType() == 1 && req.getIsSelf() == 2){ | |||
assVehicleRelieve.setOwnerName(req.getOwnerName()); | |||
assVehicleRelieve.setOwnerIdNum(req.getOwnerIdNum()); | |||
assVehicleRelieve.setOwnerPosImgUrl(req.getOwnerPosImgUrl()); | |||
assVehicleRelieve.setOwnerNegImgUrl(req.getOwnerNegImgUrl()); | |||
if (req.getOwnerIdType() != null) { | |||
if (req.getOwnerIdType() == 101){ | |||
assVehicleRelieve.setOwnerName(req.getOwnerName()); | |||
assVehicleRelieve.setOwnerIdNum(req.getOwnerIdNum()); | |||
assVehicleRelieve.setOwnerPosImgUrl(req.getOwnerPosImgUrl()); | |||
assVehicleRelieve.setOwnerNegImgUrl(req.getOwnerNegImgUrl()); | |||
}else { | |||
assVehicleRelieve.setUnitImagesUrl(req.getUnitImagesUrl()); | |||
assVehicleRelieve.setProxyUrl(req.getProxyUrl()); | |||
assVehicleRelieve.setUnitIdType(IdType.YYZZ); | |||
assVehicleRelieve.setUnitName(req.getUnitName()); | |||
assVehicleRelieve.setUnitId(req.getUnitId()); | |||
} | |||
} | |||
if (qtkCardInfo != null) { | |||
assVehicleRelieve.setRelieveCardId(qtkCardInfo.getCardId()); |
@@ -1,8 +1,6 @@ | |||
package cn.com.taiji.ias.manager.ass.releasePlate; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.pub.TimeTools; | |||
import cn.com.taiji.core.entity.ass.AssOrderinfo; | |||
import cn.com.taiji.core.entity.ass.AssVehicleRelieve; | |||
import cn.com.taiji.core.entity.basic.QtkBlackCard; | |||
@@ -19,14 +17,12 @@ import cn.com.taiji.core.entity.dict.issue.TransactionBizType; | |||
import cn.com.taiji.core.entity.dict.ygz.DataSourceEnum; | |||
import cn.com.taiji.core.entity.dict.ygz.Operation; | |||
import cn.com.taiji.core.entity.user.Staff; | |||
import cn.com.taiji.core.model.comm.protocol.AbstractSignTypeResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ass.ReleasePlateReviewRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ass.ReleasePlateReviewResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.*; | |||
import cn.com.taiji.core.model.comm.protocol.valid.ErrorMsgBuilder; | |||
import cn.com.taiji.core.repo.jpa.ass.AssVehicleRelieveRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkBlackCardRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkBlackObuRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkObuInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.user.StaffRepo; | |||
@@ -41,7 +37,6 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.io.IOException; | |||
import java.time.LocalDateTime; | |||
import java.util.Calendar; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.stream.Collectors; |
@@ -47,7 +47,10 @@ public class OrderConsigneeManager extends AbstractOrderManager<IssueOrderConsig | |||
@Override | |||
protected void persistInternal(IssueOrderConsigneeRequest req, ServiceLogEvent event, | |||
Map<String, Object> dataStream) throws ServiceHandleException { | |||
CsmsnConsignee consignee = new CsmsnConsignee(); | |||
CsmsnConsignee consignee = csmsnConsigneeRepo.findByObuId(req.getObuId()); | |||
if (consignee == null){ | |||
consignee = new CsmsnConsignee(); | |||
} | |||
consignee.setInsertTime(LocalDateTime.now()); | |||
consignee.setAgencyId(req.getOrgCode()); | |||
consignee.setOnlineOrderNo(req.getOnlineOrderNo()); | |||
@@ -56,7 +59,7 @@ public class OrderConsigneeManager extends AbstractOrderManager<IssueOrderConsig | |||
consignee.setTrackingNumber(req.getTrackingNumber()); | |||
consignee.setCourierCompany(req.getCourierCompany()); | |||
consignee.setDeliveryAddress(req.getDeliveryAddress()); | |||
csmsnConsigneeRepo.persist(consignee); | |||
csmsnConsigneeRepo.save(consignee); | |||
} | |||
@Override |