@@ -90,10 +90,10 @@ public class AssOrderinfo extends AbstractStringPropertyUUIDEntity { | |||
private String remark;//备注 | |||
@NotNull | |||
@Column(name = "INSERT_TIME") | |||
private LocalDateTime insertTime;//入库时间 | |||
private LocalDateTime insertTime = LocalDateTime.now();//入库时间 | |||
@NotNull | |||
@Column(name = "UPDATE_TIME") | |||
private LocalDateTime updateTime;//更新时间 | |||
private LocalDateTime updateTime = LocalDateTime.now();//更新时间 | |||
@Column(name = "URGENT") | |||
private Integer urgent = 0;//是否催单,1是,0否 | |||
@Column(name = "VEHICLE_ID") |
@@ -8,6 +8,7 @@ import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.persistence.*; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.Size; | |||
import java.time.LocalDateTime; | |||
@@ -36,7 +37,6 @@ public class AssVehicleRelieve extends AbstractStringPropertyUUIDEntity { | |||
private String relieveObuId;//解除的签号;被解除的OBU签号 | |||
@Column(name = "RELIEVE_TIME") | |||
private LocalDateTime relieveTime;//解除时间 | |||
@Size(max = 32) | |||
@Column(name = "RELIEVE_STATUS") | |||
@Enumerated(EnumType.STRING) | |||
private RelieveStatus relieveStatus;//解除状态;未处理、已处理成功、已处理失败 | |||
@@ -46,7 +46,6 @@ public class AssVehicleRelieve extends AbstractStringPropertyUUIDEntity { | |||
@Size(max = 255) | |||
@Column(name = "USER_NEG_IMAGES_URL") | |||
private String userNegImagesUrl;//身份证国徽图片地址(申请人) | |||
@Size(max = 32) | |||
@Column(name = "USER_TYPE") | |||
@Enumerated(EnumType.STRING) | |||
private IdType userType;//证件类型;身份证、 | |||
@@ -54,12 +53,14 @@ public class AssVehicleRelieve extends AbstractStringPropertyUUIDEntity { | |||
private String vehPosImgUrl;//行驶证正面照片 | |||
@Column(name = "VEH_NEG_IMG_URL") | |||
private String vehNegImgUrl;//行驶证反面 照片 | |||
@NotBlank | |||
@Column(name = "VEH_OWNER_NAME") | |||
private String vehicleOwnerName;//行驶证上所有人 | |||
@Size(max = 255) | |||
@Column(name = "UNIT_IMAGES_URL") | |||
private String unitImagesUrl;//营业执照图片地址 | |||
@Column(name = "PROXY_URL") | |||
private String proxyUrl;//授权书图片地址 | |||
@Size(max = 32) | |||
@Column(name = "UNIT_ID_TYPE") | |||
@Enumerated(EnumType.STRING) | |||
private IdType unitIdType;//单位证件类型 | |||
@@ -73,9 +74,9 @@ public class AssVehicleRelieve extends AbstractStringPropertyUUIDEntity { | |||
@Column(name = "REMARK") | |||
private String remark;//备注 | |||
@Column(name = "INSERT_TIME") | |||
private LocalDateTime insertTime;//创建时间 | |||
private LocalDateTime insertTime = LocalDateTime.now();//创建时间 | |||
@Column(name = "UPDATE_TIME") | |||
private LocalDateTime updateTime;//更新时间 | |||
private LocalDateTime updateTime = LocalDateTime.now();//更新时间 | |||
@Column(name = "OWNER_POS_IMGURL") | |||
private String ownerPosImgUrl;//车主证件正面图片 | |||
@Column(name = "OWNER_NEG_IMGURL") | |||
@@ -91,4 +92,5 @@ public class AssVehicleRelieve extends AbstractStringPropertyUUIDEntity { | |||
} |
@@ -116,8 +116,8 @@ public class IssueOrderinfo extends AbstractStringPropertyUUIDEntity { | |||
private LocalDateTime activationTime;//订单激活时间 | |||
@Column(name = "DELIVERY_TIME") | |||
private LocalDateTime deliveryTime;//邮寄时间 | |||
@Column(name = "PAY_TIME") | |||
private LocalDateTime payTime;//支付时间 | |||
// @Column(name = "PAY_TIME") | |||
// private LocalDateTime payTime;//支付时间 | |||
@Column(name = "CANCEL_TIME") | |||
private LocalDateTime cancelTime;//订单取消时间 | |||
@Column(name = "RECEIVING_TIME") |
@@ -19,7 +19,7 @@ import javax.validation.Valid; | |||
@Api(tags = {"客户信息修改"}) | |||
@RestController | |||
@RequestMapping("/CustomerInfoChange") | |||
@RequestMapping("/customerInfoChange") | |||
public class CustomerInfoChangeController extends MyValidController { | |||
@Autowired |
@@ -77,7 +77,7 @@ public class CustomerInfoChangeApplyDTO extends AbstractBizRequestDTO { | |||
if(("2").equals(type)){ | |||
validator.validFieldNotBlank("agentName", agentName); | |||
validator.validFieldNotBlank("agentIdNo", agentIdNo); | |||
validator.validFieldNotBlank("agentAddress", agentAddress); | |||
// validator.validFieldNotBlank("agentAddress", agentAddress); | |||
validator.validFieldNotBlank("agentIdCardFront", agentIdCardFront); | |||
validator.validFieldNotBlank("agentIdCardBack", agentIdCardBack); | |||
}else { |
@@ -31,7 +31,6 @@ public class CustomerInfoChangeMangerImpl extends AbstractIawManager implements | |||
private QtkCustomerInfoRepo customerInfoRepo; | |||
@Autowired | |||
private AssOrderinfoRepo orderInfoRepo; | |||
@Autowired | |||
private MinioUtil minioUtil; | |||
@@ -4,10 +4,7 @@ import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.managew.api.MyValidController; | |||
import cn.com.taiji.managew.dto.ass.AssCustomerInfoChangeDetailReqDTO; | |||
import cn.com.taiji.managew.dto.ass.AssCustomerInfoChangeDetailResDTO; | |||
import cn.com.taiji.managew.dto.ass.AssCustomerInfoChangePageReqDTO; | |||
import cn.com.taiji.managew.dto.ass.CustomerInfoChangeAuditDTO; | |||
import cn.com.taiji.managew.dto.ass.*; | |||
import cn.com.taiji.managew.manager.ass.CustomerInfoChangeManager; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
@@ -21,7 +18,7 @@ import javax.validation.Valid; | |||
@Api(tags = {"客户信息修改"}) | |||
@RestController | |||
@RequestMapping("/CustomerInfoChange") | |||
@RequestMapping("/customerInfoChange") | |||
public class CustomerInfoChangeController extends MyValidController { | |||
@Autowired | |||
@@ -45,4 +42,11 @@ public class CustomerInfoChangeController extends MyValidController { | |||
manager.audit(reqDto); | |||
return ApiResponse.success().setMessage("操作成功"); | |||
} | |||
@ApiOperation(value ="04-信息修改申请") | |||
@PostMapping("/apply") | |||
public ApiResponse apply(@Valid @RequestBody CustomerInfoChangeApplyDTO reqDto) throws ManagerException { | |||
manager.apply(reqDto); | |||
return ApiResponse.success().setMessage("操作成功"); | |||
} | |||
} |
@@ -0,0 +1,94 @@ | |||
package cn.com.taiji.managew.dto.ass; | |||
import cn.com.taiji.common.valid.ViolationValidator; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.StringConstant; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
@ApiModel(description = "信息修改申请") | |||
@Getter | |||
@Setter | |||
public class CustomerInfoChangeApplyDTO extends AbstractStaffBizRequestDTO { | |||
@NotBlank(message = "业务类型不能为空") | |||
@ApiModelProperty(value = "业务类型 1-个人 2-单位") | |||
@StringConstant(values = "1,2") | |||
private String type; | |||
@NotBlank(message = "姓名/单位名称不能为空") | |||
@ApiModelProperty(value = "姓名/单位名称", required = true) | |||
private String name; | |||
@NotBlank(message = "证件号码不能为空") | |||
@ApiModelProperty(value = "证件号码", required = true) | |||
private String idNo; | |||
@NotBlank(message = "地址不能为空") | |||
@ApiModelProperty(value = "地址", required = true) | |||
private String address; | |||
@NotBlank(message = "手机号不能为空") | |||
@ApiModelProperty(value = "手机号", required = true) | |||
private String tel; | |||
@ApiModelProperty(value = "有效期 个人时必填") | |||
private String vld; | |||
@ApiModelProperty(value = "经办人") | |||
private String agentName; | |||
@ApiModelProperty(value = "经办人证件号") | |||
private String agentIdNo; | |||
@ApiModelProperty(value = "经办人地址") | |||
private String agentAddress; | |||
@ApiModelProperty(value = "验证码 发送验证码的businessType用'3'") | |||
private String verifyCode; | |||
@NotBlank(message = "证件正面不能为空") | |||
@ApiModelProperty(value = "证件正面") | |||
private String idCardFront; | |||
@ApiModelProperty(value = "证件反面") | |||
private String idCardBack; | |||
@ApiModelProperty(value = "经办人证件正面") | |||
private String agentIdCardFront; | |||
@ApiModelProperty(value = "经办人证件反面") | |||
private String agentIdCardBack; | |||
@NotBlank | |||
@ApiModelProperty(value = "手机号是否变更,变更时验证码必填 1-否 2-是", required = true) | |||
private String mobileChange; | |||
@NotBlank | |||
@ApiModelProperty(value = "客户id") | |||
private String customerId; | |||
@Override | |||
protected void validate(ViolationValidator validator) { | |||
if(("2").equals(type)){ | |||
validator.validFieldNotBlank("agentName", agentName); | |||
validator.validFieldNotBlank("agentIdNo", agentIdNo); | |||
// validator.validFieldNotBlank("agentAddress", agentAddress); | |||
validator.validFieldNotBlank("agentIdCardFront", agentIdCardFront); | |||
validator.validFieldNotBlank("agentIdCardBack", agentIdCardBack); | |||
}else { | |||
validator.validFieldNotBlank("idCardBack", idCardBack); | |||
validator.validFieldNotBlank("vld", vld); | |||
} | |||
if(("2").equals(mobileChange)){ | |||
validator.validFieldNotBlank("verifyCode", verifyCode); | |||
} | |||
if (getOrderSource() == SourceType.SERVICE_HALL) { | |||
validator.validFieldNotBlank("staffId", getStaffId()); | |||
} | |||
} | |||
} |
@@ -20,8 +20,8 @@ public class BasicInfoCustomerPageRequestDTO extends AbstractStaffBizPageRequest | |||
private String customerName; | |||
//用户证件类型 | |||
@ApiModelProperty(value = "用户证件类型") | |||
@Enumerated(EnumType.STRING) | |||
private IdType customerIdType; | |||
// @Enumerated(EnumType.STRING) | |||
private String customerIdType; | |||
//用户证件号码 | |||
@ApiModelProperty(value = "用户证件号码") | |||
private String customerIdNum; |
@@ -15,7 +15,7 @@ public class BasicInfoVehiclePageRequestDTO extends AbstractStaffBizPageRequestD | |||
@ApiModelProperty(value = "用户证件类型") | |||
@Enumerated(EnumType.STRING) | |||
private IdType customerIdType; | |||
private String customerIdType; | |||
@ApiModelProperty(value = "用户证件号") | |||
private String customerIdNum; | |||
@ApiModelProperty(value = "用户编号") |
@@ -2,14 +2,12 @@ package cn.com.taiji.managew.manager.ass; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.managew.dto.ass.AssCustomerInfoChangeDetailReqDTO; | |||
import cn.com.taiji.managew.dto.ass.AssCustomerInfoChangeDetailResDTO; | |||
import cn.com.taiji.managew.dto.ass.AssCustomerInfoChangePageReqDTO; | |||
import cn.com.taiji.managew.dto.ass.CustomerInfoChangeAuditDTO; | |||
import cn.com.taiji.managew.dto.ass.*; | |||
public interface CustomerInfoChangeManager { | |||
Pagination page(AssCustomerInfoChangePageReqDTO reqDto) throws ManagerException; | |||
AssCustomerInfoChangeDetailResDTO detail(AssCustomerInfoChangeDetailReqDTO reqDto) throws ManagerException; | |||
void audit(CustomerInfoChangeAuditDTO reqDto) throws ManagerException; | |||
void apply(CustomerInfoChangeApplyDTO reqDto) throws ManagerException; | |||
} |
@@ -4,13 +4,19 @@ import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.entity.ass.AssCustomerInfoChange; | |||
import cn.com.taiji.core.entity.ass.AssOrderinfo; | |||
import cn.com.taiji.core.entity.basic.QtkCustomerInfo; | |||
import cn.com.taiji.core.entity.dict.ass.AssOrderStatus; | |||
import cn.com.taiji.core.entity.dict.ass.AssOrderType; | |||
import cn.com.taiji.core.entity.dict.log.OperateType; | |||
import cn.com.taiji.core.entity.user.Staff; | |||
import cn.com.taiji.core.manager.cache.RedisKeyGenerator; | |||
import cn.com.taiji.core.manager.tools.minio.MinioUtil; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ass.CommCustomerInfoChangeResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ass.CustomerInfoChangeApplyRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ass.CustomerInfoChangeAuditRequest; | |||
import cn.com.taiji.core.repo.jpa.ass.AssCustomerInfoChangeRepo; | |||
import cn.com.taiji.core.repo.jpa.ass.AssOrderinfoRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkCustomerInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.user.StaffRepo; | |||
import cn.com.taiji.managew.dto.ass.*; | |||
import cn.com.taiji.managew.manager.AbstractManagewManager; | |||
@@ -21,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
@Service | |||
public class CustomerInfoChangeManagerImpl extends AbstractManagewManager implements CustomerInfoChangeManager{ | |||
@@ -31,6 +38,10 @@ public class CustomerInfoChangeManagerImpl extends AbstractManagewManager implem | |||
private AssCustomerInfoChangeRepo changeRepo; | |||
@Autowired | |||
private StaffRepo staffRepo; | |||
@Autowired | |||
private QtkCustomerInfoRepo customerInfoRepo; | |||
@Autowired | |||
private MinioUtil minioUtil; | |||
@Override | |||
public Pagination page(AssCustomerInfoChangePageReqDTO reqDto) throws ManagerException { | |||
@@ -85,10 +96,15 @@ public class CustomerInfoChangeManagerImpl extends AbstractManagewManager implem | |||
AssOrderInfoModel orderInfo = copyProperties(order, new AssOrderInfoModel()); | |||
AssCustomerInfoChangeModel changeInfo = copyProperties(change, new AssCustomerInfoChangeModel()); | |||
if(hasText(orderInfo.getAuditOpenId())){ | |||
Staff staff = staffRepo.findByOpenId(orderInfo.getAuditOpenId()); | |||
if(staff != null) { | |||
orderInfo.setAuditUserName(staff.getStaffName()); | |||
String openId = orderInfo.getAuditOpenId(); | |||
if(hasText(openId)){ | |||
if ("-1".equals(openId)){ | |||
orderInfo.setAuditUserName("系统"); | |||
}else { | |||
Staff staff = staffRepo.findByOpenId(orderInfo.getAuditOpenId()); | |||
if (staff != null) { | |||
orderInfo.setAuditUserName(staff.getStaffName()); | |||
} | |||
} | |||
} | |||
@@ -110,4 +126,60 @@ public class CustomerInfoChangeManagerImpl extends AbstractManagewManager implem | |||
throw new ManagerException("出错了" + response.getMsg()); | |||
} | |||
} | |||
@Override | |||
public void apply(CustomerInfoChangeApplyDTO reqDto) throws ManagerException { | |||
valid(reqDto); | |||
CustomerInfoChangeApplyRequest request = copyProperties(reqDto, new CustomerInfoChangeApplyRequest()); | |||
request.setLoginSource(reqDto.getOrderSource()); | |||
CommCustomerInfoChangeResponse response = jsonPostRepeat(request); | |||
//记录日志 | |||
persistOperateLog(("1").equals(reqDto.getType()) ? OperateType.CUSTOMER_INFO_CHANGE_APPLY_SELF : OperateType.CUSTOMER_INFO_CHANGE_APPLY_UNIT, response.getOrderNo()!=null?response.getOrderNo():"-1", reqDto.getOrderSource(), findOpenIdByToken(reqDto.getAccessToken()), "用户信息变更申请" + response.getMsg()); | |||
//响应 | |||
if (!"1".equals(response.getCode())) { | |||
throw new ManagerException("出错了" + response.getMsg()); | |||
} | |||
} | |||
// 校验 | |||
private void valid(CustomerInfoChangeApplyDTO reqDto) throws ManagerException { | |||
reqDto.validate(); | |||
List<AssOrderinfo> order = orderInfoRepo.findByCustomerIdAndOrderTypeStatus(reqDto.getCustomerId(), AssOrderType.USER_UPDATE, AssOrderStatus.NORMAL); | |||
if (!order.isEmpty()) { | |||
throw new ManagerException("正在处理中,请勿重复提交!"); | |||
} | |||
QtkCustomerInfo customer = customerInfoRepo.findByCustomerId(reqDto.getCustomerId()); | |||
if (customer == null) { | |||
throw new ManagerException("客户不存在!"); | |||
} | |||
if (!customer.getCustomerIdNum().equals(reqDto.getIdNo())) { | |||
throw new ManagerException("证件号码不允许修改,请核对证件号码是否正确!"); | |||
} | |||
if(!customer.getCustomerTel().equals(reqDto.getTel())){ | |||
if(!hasText(reqDto.getVerifyCode())){ | |||
throw new ManagerException("手机号发生变更,请输入手机验证码!"); | |||
} | |||
} | |||
if (("2").equals(reqDto.getMobileChange())) { | |||
String smsCode = redisManager.get(RedisKeyGenerator.getSmsCodeKey(reqDto.getTel(), reqDto.getOrderSource().name(), 3)); | |||
if (!hasText(smsCode)) { | |||
throw new ManagerException("短信验证码已过期,请重新发送!"); | |||
} | |||
if (!smsCode.equals(reqDto.getVerifyCode())) { | |||
throw new ManagerException("短信验证码错误!"); | |||
} | |||
} | |||
if (hasText(reqDto.getIdCardFront())) { | |||
reqDto.setIdCardFront(reqDto.getIdCardFront().replace(minioUtil.getProxyUrl(), "")); | |||
} | |||
if (hasText(reqDto.getIdCardBack())) { | |||
reqDto.setIdCardBack(reqDto.getIdCardBack().replace(minioUtil.getProxyUrl(), "")); | |||
} | |||
if (hasText(reqDto.getAgentIdCardFront())) { | |||
reqDto.setAgentIdCardFront(reqDto.getAgentIdCardFront().replace(minioUtil.getProxyUrl(), "")); | |||
} | |||
if (hasText(reqDto.getAgentIdCardBack())) { | |||
reqDto.setAgentIdCardBack(reqDto.getAgentIdCardBack().replace(minioUtil.getProxyUrl(), "")); | |||
} | |||
} | |||
} |
@@ -6,6 +6,7 @@ import cn.com.taiji.core.entity.basic.QtkCardInfo; | |||
import cn.com.taiji.core.entity.basic.QtkCustomerInfo; | |||
import cn.com.taiji.core.entity.basic.QtkObuInfo; | |||
import cn.com.taiji.core.entity.basic.QtkVehicleInfo; | |||
import cn.com.taiji.core.entity.dict.basic.IdType; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkCustomerInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkObuInfoRepo; | |||
@@ -17,6 +18,7 @@ import cn.com.taiji.core.repo.request.basic.QtkVehicleInfoPageRequest; | |||
import cn.com.taiji.managew.dto.basic.basicInfo.*; | |||
import cn.com.taiji.managew.manager.AbstractCommManager; | |||
import cn.com.taiji.managew.model.basic.BasicInfoCardModel; | |||
import cn.com.taiji.managew.model.basic.BasicInfoCustomerModel; | |||
import cn.com.taiji.managew.model.basic.BasicInfoObuModel; | |||
import cn.com.taiji.managew.model.basic.BasicInfoVehicleModel; | |||
import org.springframework.beans.BeanUtils; | |||
@@ -41,7 +43,10 @@ public class BasicInfoManagerImpl extends AbstractCommManager implements BasicIn | |||
public Pagination queryCustomer(BasicInfoCustomerPageRequestDTO req) { | |||
QtkCustomerInfoPageRequest request = new QtkCustomerInfoPageRequest(); | |||
BeanUtils.copyProperties(req, request); | |||
return customerInfoRepo.page(request); | |||
if(hasText(req.getCustomerIdType())) { | |||
request.setCustomerIdType(IdType.findByCode(Integer.valueOf(req.getCustomerIdType()))); | |||
} | |||
return customerInfoRepo.page(request).convertResult(this::coverCustomer); | |||
} | |||
@Override | |||
@@ -52,13 +57,16 @@ public class BasicInfoManagerImpl extends AbstractCommManager implements BasicIn | |||
if (req.getCustomerIdType() == null) { | |||
customerIds = customerInfoRepo.findCustomerIdByIdNum(req.getCustomerIdNum()); | |||
} else { | |||
customerIds = customerInfoRepo.findCustomerIdByIdNumAndIdType(req.getCustomerIdNum(), req.getCustomerIdType()); | |||
customerIds = customerInfoRepo.findCustomerIdByIdNumAndIdType(req.getCustomerIdNum(), IdType.findByCode(Integer.valueOf(req.getCustomerIdType()))); | |||
} | |||
} | |||
BeanUtils.copyProperties(req, request); | |||
if(!isEmpty(customerIds)){ | |||
request.setCustomerIds(customerIds); | |||
} | |||
if(hasText(req.getCustomerIdType())){ | |||
request.setCustomerIdType(IdType.findByCode(Integer.valueOf(req.getCustomerIdType()))); | |||
} | |||
return vehicleInfoRepo.page(request).convertResult(this::coverVeh); | |||
} | |||
@@ -116,6 +124,18 @@ public class BasicInfoManagerImpl extends AbstractCommManager implements BasicIn | |||
return response; | |||
} | |||
private BasicInfoCustomerModel coverCustomer(QtkCustomerInfo qtkCustomerInfo) { | |||
BasicInfoCustomerModel model = new BasicInfoCustomerModel(); | |||
BeanUtils.copyProperties(qtkCustomerInfo, model); | |||
if(qtkCustomerInfo.getCustomerIdType() != null) { | |||
model.setCustomerIdType(qtkCustomerInfo.getCustomerIdType().getValue()); | |||
} | |||
if(qtkCustomerInfo.getAgentIdType() != null) { | |||
model.setAgentIdtype(qtkCustomerInfo.getAgentIdType().getValue()); | |||
} | |||
return model; | |||
} | |||
private BasicInfoObuModel coverObu(QtkObuInfo qtkObuInfo) { | |||
BasicInfoObuModel model = new BasicInfoObuModel(); | |||
BeanUtils.copyProperties(qtkObuInfo, model); | |||
@@ -147,6 +167,9 @@ public class BasicInfoManagerImpl extends AbstractCommManager implements BasicIn | |||
private BasicInfoVehicleModel coverVeh(QtkVehicleInfo qtkVehicleInfo) { | |||
BasicInfoVehicleModel model = new BasicInfoVehicleModel(); | |||
BeanUtils.copyProperties(qtkVehicleInfo, model); | |||
if(qtkVehicleInfo.getUseUserType() != null) { | |||
model.setOwnerIdType(qtkVehicleInfo.getOwnerIdType().getValue()); | |||
} | |||
//图片地址转换 | |||
extracted(model); | |||
return model; |
@@ -17,14 +17,14 @@ public class BasicInfoCustomerModel extends BaseModel { | |||
private String seriseNo;//流水编号 | |||
private UserType userType;//用户类型1-个人 2-单位 | |||
private String customerName;//用户姓名 | |||
private IdType customerIdType;//用户证件类型 | |||
private String customerIdType;//用户证件类型 | |||
private String customerIdNum;//用户证件号 | |||
private String customerTel;//用户手机号 | |||
private String customerAddress;//开户人地址 | |||
private String customerPosImgUrl;//开户人正面图片地址 | |||
private String customerNegImgUrl;//开户人反面图片地址 | |||
private String agentName;//指定经办人姓名 | |||
private IdType agentIdtype;//指定经办人证件类型 | |||
private String agentIdtype;//指定经办人证件类型 | |||
private String agentIdNum;//指定经办人证件号码 | |||
private String agentPosImgUrl;//指定经办人正面图片地址 | |||
private String agentNegImgUrl;//指定经办人反面图片地址 |
@@ -34,7 +34,7 @@ public class BasicInfoVehicleModel extends BaseModel { | |||
private String vehPosImgUrl;//行驶证正面图片地址; | |||
private String vehNegImgUrl;//行驶证反面图片地址; | |||
private String ownerName;//车主姓名; | |||
private IdType ownerIdType;//车主证件类型; | |||
private String ownerIdType;//车主证件类型; | |||
private String ownerIdNum;//车主证件号码; | |||
private String ownerPosImgUrl;//车主证件正面图片的BASE64编码; | |||
private String ownerNegImgUrl;//车主证件反面图片的BASE64编码; |
@@ -61,4 +61,11 @@ public class MessageSharedController { | |||
return ApiResponse.of(pagination); | |||
} | |||
@ApiOperation(value = "首页统计") | |||
@PostMapping(value = "/homeStatistics") | |||
public ApiResponse<HomeStatisticsResponseDto> homeStatistics(@RequestBody @Valid HomeStatisticsRequestDto request){ | |||
HomeStatisticsResponseDto responseDto = messageWaitSendManager.homeStatistics(request); | |||
return ApiResponse.of(responseDto); | |||
} | |||
} |
@@ -0,0 +1,29 @@ | |||
package cn.com.taiji.msgw.dto; | |||
import cn.com.taiji.common.entity.BaseEntity; | |||
import cn.com.taiji.core.entity.dict.msgw.MessageType; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import java.time.LocalDateTime; | |||
@Getter | |||
@Setter | |||
public class HomeStatisticsRequestDto extends BaseEntity { | |||
/** | |||
* 消息类型 | |||
*/ | |||
private MessageType messageType; | |||
/*** | |||
* 统计开始日期 | |||
*/ | |||
private LocalDateTime startDate; | |||
/*** | |||
* 统计结束日期 | |||
*/ | |||
private LocalDateTime endDate; | |||
} |
@@ -0,0 +1,19 @@ | |||
package cn.com.taiji.msgw.dto; | |||
import java.util.List; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import cn.com.taiji.core.entity.msgw.MsgwSmsKeyConfig; | |||
import cn.com.taiji.msgw.model.HomeStatisticsModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class HomeStatisticsResponseDto extends BaseModel { | |||
List<HomeStatisticsModel> list; | |||
} |
@@ -31,4 +31,7 @@ public interface MessageWaitSendManager { | |||
/**用户分页*/ | |||
Pagination userPage(UserListRequestDto request); | |||
/**首页统计*/ | |||
HomeStatisticsResponseDto homeStatistics(HomeStatisticsRequestDto request); | |||
} |
@@ -4,6 +4,7 @@ import java.time.LocalDateTime; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import cn.com.taiji.msgw.model.HomeStatisticsModel; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -198,9 +199,6 @@ public class MessageWaitSendManagerImpl extends AbstractCommManager implements M | |||
return sendDetailsRepo.page(request); | |||
} | |||
@Override | |||
public Pagination userPage(UserListRequestDto request){ | |||
Pagination pagination = new Pagination(); | |||
@@ -236,5 +234,35 @@ public class MessageWaitSendManagerImpl extends AbstractCommManager implements M | |||
return pagination; | |||
} | |||
@Override | |||
public HomeStatisticsResponseDto homeStatistics(HomeStatisticsRequestDto request) { | |||
HomeStatisticsResponseDto response = new HomeStatisticsResponseDto(); | |||
// 获取开始时间与结束时间 | |||
LocalDateTime startDateTime = request.getStartDate(); | |||
LocalDateTime endDateTime = request.getEndDate(); | |||
// 循环从开始日期到结束日期的前一天 | |||
List<HomeStatisticsModel> list = new ArrayList<>(); | |||
LocalDateTime currentDate = startDateTime; | |||
while (currentDate.isBefore(endDateTime)) { | |||
LocalDateTime nextDate = currentDate.plusDays(1); | |||
Long totalNum = sendDetailsRepo.countStatistics(request.getMessageType(), null, currentDate, nextDate); | |||
//成功消息总数 | |||
Long successTotalNum = sendDetailsRepo.countStatistics(request.getMessageType(), MessageResult.SEND, currentDate, nextDate); | |||
//失败消息总数 | |||
Long failTotalNum = sendDetailsRepo.countStatistics(request.getMessageType(), MessageResult.FAIL, currentDate, nextDate); | |||
//待发送消息总数 | |||
Long waitTotalNum = sendDetailsRepo.countStatistics(request.getMessageType(), MessageResult.WAIT, currentDate, nextDate); | |||
//过期消息总数 | |||
Long expiredTotalNum = sendDetailsRepo.countStatistics(request.getMessageType(), MessageResult.EXPIRED, currentDate, nextDate); | |||
//取消消息总数 | |||
Long cancelTotalNum = sendDetailsRepo.countStatistics(request.getMessageType(), MessageResult.CANCEL, currentDate, nextDate); | |||
HomeStatisticsModel model = new HomeStatisticsModel(currentDate.toLocalDate().toString(), totalNum, successTotalNum, failTotalNum, waitTotalNum, expiredTotalNum, cancelTotalNum); | |||
list.add(model); | |||
currentDate = nextDate; | |||
} | |||
response.setList(list); | |||
return response; | |||
} | |||
} |
@@ -0,0 +1,29 @@ | |||
package cn.com.taiji.msgw.model; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@Getter | |||
@Setter | |||
public class HomeStatisticsModel extends BaseModel { | |||
private String date; | |||
private Long totalNum; | |||
private Long successTotalNum; | |||
private Long failTotalNum; | |||
private Long waitTotalNum; | |||
private Long expiredTotalNum; | |||
private Long cancelTotalNum; | |||
public HomeStatisticsModel(String date, Long totalNum, Long successTotalNum, Long failTotalNum, Long waitTotalNum, Long expiredTotalNum, Long cancelTotalNum) { | |||
this.date = date; | |||
this.totalNum = totalNum; | |||
this.successTotalNum = successTotalNum; | |||
this.failTotalNum = failTotalNum; | |||
this.waitTotalNum = waitTotalNum; | |||
this.expiredTotalNum = expiredTotalNum; | |||
this.cancelTotalNum = cancelTotalNum; | |||
} | |||
} |
@@ -179,11 +179,11 @@ public class TransactionHandleManagerImpl extends AbstractCommManager implements | |||
} | |||
QtkVehicleInfo vehicleInfo = vehicleInfoRepo.findByVehicleId(orderInfo.getVehicleId()); | |||
if (vehicleInfo == null) { | |||
sb.append("车辆信息不存在"); | |||
// sb.append("车辆信息不存在"); | |||
} | |||
QtkCustomerInfo customerInfo = customerInfoRepo.findByCustomerId(orderInfo.getCustomerId()); | |||
if (customerInfo == null) { | |||
sb.append("用户信息不存在"); | |||
// sb.append("用户信息不存在"); | |||
} | |||
request.setOrder(orderInfo); |
@@ -1,6 +1,6 @@ | |||
spring: | |||
application: | |||
name: ats | |||
name: ats-local | |||
mvc: | |||
locale: zh_CN | |||
messages: |
@@ -35,11 +35,11 @@ public abstract class AbstractCustomerInfoChangeManager extends AbstractCommMana | |||
customerInfo.setCustomerName(change.getCustomerName()); | |||
customerInfo.setCustomerAddress(change.getCustomerAddress()); | |||
customerInfo.setCustomerTel(change.getCustomerTel()); | |||
customerInfo.setCustomerNegImgUrl(change.getCustomerNegUrl()); | |||
customerInfo.setCustomerPosImgUrl(change.getCustomerPosUrl()); | |||
customerInfo.setUpdateTime(LocalDateTime.now()); | |||
if ("1".equals(type)) { | |||
customerInfo.setCustomerNegImgUrl(change.getCustomerNegUrl()); | |||
customerInfo.setCustomerVid(change.getCustomerVid()); | |||
} else if ("2".equals(type)) { | |||
customerInfo.setAgentName(change.getAgentName()); |
@@ -273,9 +273,9 @@ public class CustomerInfoChangeApplyManager extends AbstractCustomerInfoChangeMa | |||
if (!agentRes.getIdno().equals(request.getAgentIdNo())) { | |||
builder.append("经办人证件号码【").append(request.getAgentIdNo()).append("】与识别结果【").append(agentRes.getIdno()).append("】不一致;"); | |||
} | |||
if (!agentRes.getAddress().equals(request.getAgentAddress())) { | |||
builder.append("经办人地址【").append(request.getAgentAddress()).append("】与识别结果【").append(agentRes.getAddress()).append("】不一致;"); | |||
} | |||
// if (!agentRes.getAddress().equals(request.getAgentAddress())) { | |||
// builder.append("经办人地址【").append(request.getAgentAddress()).append("】与识别结果【").append(agentRes.getAddress()).append("】不一致;"); | |||
// } | |||
} catch (IOException e) { | |||
builder.append("经办人证件识别结果异常;"); | |||
logger.error("经办人证件识别结果异常", e); |
@@ -15,6 +15,7 @@ import cn.com.taiji.core.model.comm.protocol.ias.ass.ReleasePlateApplyResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.vaild.VehiclePlateCheckResponse; | |||
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.QtkCustomerInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.user.AccountInfoRepo; | |||
import cn.com.taiji.ias.dict.DataType; | |||
import cn.com.taiji.ias.manager.ass.AbstractAssManager; | |||
@@ -38,6 +39,8 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
@Autowired | |||
private AccountInfoRepo accountInfoRepo; | |||
@Autowired | |||
private QtkCustomerInfoRepo qtkCustomerInfoRepo; | |||
public ReleasePlateApplyManager() { | |||
super(DataType.RELEASE_PLATE_APPLY); | |||
@@ -97,7 +100,7 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
throw newBusinessException("该车牌号未被占用,无需申请"); | |||
} | |||
//外省发行方占用 | |||
if (!res.getInfo().contains("贵州")) { | |||
if (res.getResult() != 4 && !res.getInfo().contains("贵州")) { | |||
throw newBusinessException(res.getInfo()); | |||
} | |||
dataStream.put(CARD_INFO, qtkCardInfo); | |||
@@ -114,12 +117,12 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
//双系统查询ETC用户信息 | |||
QtkCustomerInfo customerInfo = queryCustomerInfo(qtkVehicleInfo.getCustomerId()); | |||
//占用用户和申请用户一致 | |||
if(req.getCustomerIdNum().equals(customerInfo.getCustomerIdNum())){ | |||
//校验卡 | |||
validCard(dataStream); | |||
//校验签 | |||
validObu(dataStream); | |||
} | |||
// if(req.getCustomerIdNum().equals(customerInfo.getCustomerIdNum())){ | |||
// //校验卡 | |||
// validCard(dataStream); | |||
// //校验签 | |||
// validObu(dataStream); | |||
// } | |||
} | |||
private void validCard(Map<String, Object> dataStream) throws ServiceHandleException { | |||
@@ -133,7 +136,7 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
//卡状态正常和挂失状态引导走正常注销流程 | |||
//2、没有数据即卡状态正常 | |||
//3、有数据看是否是挂失 | |||
if (qtkBlackCards == null || qtkBlackCards.isEmpty()){ | |||
if (isEmpty(qtkBlackCards)){ | |||
throw newBusinessException("请先走注销流程"); | |||
} else { | |||
//下黑的所有类型 | |||
@@ -176,6 +179,10 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
@Override | |||
protected void persistInternal(ReleasePlateApplyRequest req, ServiceLogEvent event, Map<String, Object> dataStream) throws ServiceHandleException { | |||
QtkCardInfo qtkCardInfo = (QtkCardInfo) dataStream.get(CARD_INFO); | |||
QtkObuInfo qtkObuInfo = (QtkObuInfo) dataStream.get(OBU_INFO); | |||
//取customerId 前面已经校验,走到这里卡和签不可能全都为null | |||
String customerId = qtkCardInfo == null ? qtkObuInfo.getCustomerId() : qtkCardInfo.getCustomerId(); | |||
LocalDateTime now = LocalDateTime.now(); | |||
//保存售后表 | |||
AssOrderinfo assOrderinfo = new AssOrderinfo(); | |||
@@ -190,12 +197,13 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
// FIXME: 业务员申请的单子,用户怎么查看 | |||
if (SourceType.SERVICE_HALL == req.getSourceType() || SourceType.WEB == req.getSourceType()){ | |||
assOrderinfo.setStaffOpenId(req.getOpenId()); | |||
String openId = accountInfoRepo.findByIdNum(req.getCustomerIdNum()); | |||
if (hasText(openId)) { | |||
assOrderinfo.setOpenId(openId); | |||
} | |||
} | |||
if (SourceType.ALI == req.getSourceType() || SourceType.WECHAT == req.getSourceType()){ | |||
assOrderinfo.setOpenId(req.getOpenId()); | |||
String openId = accountInfoRepo.findByIdNum(req.getCustomerIdNum()); | |||
assOrderinfo.setOpenId(openId); | |||
// // 自营工具 和 管理端 | |||
// assOrderinfo.setAgencyId("52001106004");// 黔通智联(自营) | |||
// assOrderinfo.setChannelId("5201010600401150002"); // 黔通智联售后服务 | |||
@@ -205,6 +213,9 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
assOrderinfo.setCustomerIdType(IdType.SFZ); | |||
assOrderinfo.setCustomerIdNum(req.getCustomerIdNum()); | |||
assOrderinfo.setAuditStatus(AuditStatus.AUDIT); | |||
QtkCustomerInfo customerInfo = qtkCustomerInfoRepo.findByCustomerId(customerId); | |||
assOrderinfo.setUserType(customerInfo.getUserType());//占用车辆人的用户类型 | |||
assOrderinfo.setCustomerId(customerId);//占用车辆人的customerId | |||
//保存解除车牌占用明细表 | |||
AssVehicleRelieve assVehicleRelieve = new AssVehicleRelieve(); | |||
assVehicleRelieve.setStep(AssVehicleRealseStep.SUBMIT_AUDIT); | |||
@@ -213,6 +224,7 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
assVehicleRelieve.setUserNegImagesUrl(req.getUserNegImagesUrl()); | |||
assVehicleRelieve.setUserType(IdType.SFZ); | |||
assVehicleRelieve.setVehPosImgUrl(req.getVehPosImgUrl());////行驶证正页图片地址 | |||
assVehicleRelieve.setVehicleOwnerName(req.getVehicleOwnerName()); | |||
assVehicleRelieve.setVehNegImgUrl(req.getVehNegImgUrl()); | |||
assVehicleRelieve.setRelieveStatus(RelieveStatus.UNHANDLED); | |||
if (req.getApplyType() == 2) { | |||
@@ -228,8 +240,6 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
assVehicleRelieve.setOwnerPosImgUrl(req.getOwnerPosImgUrl()); | |||
assVehicleRelieve.setOwnerNegImgUrl(req.getOwnerNegImgUrl()); | |||
} | |||
QtkCardInfo qtkCardInfo = (QtkCardInfo) dataStream.get(CARD_INFO); | |||
QtkObuInfo qtkObuInfo = (QtkObuInfo) dataStream.get(OBU_INFO); | |||
if (qtkCardInfo != null) { | |||
assVehicleRelieve.setRelieveCardId(qtkCardInfo.getCardId()); | |||
assOrderinfo.setCardId(qtkCardInfo.getCardId()); | |||
@@ -238,8 +248,6 @@ public class ReleasePlateApplyManager extends AbstractAssManager<ReleasePlateApp | |||
assVehicleRelieve.setRelieveObuId(qtkObuInfo.getObuId()); | |||
assOrderinfo.setObuId(qtkObuInfo.getObuId()); | |||
} | |||
assVehicleRelieve.setInsertTime(now); | |||
assVehicleRelieve.setUpdateTime(now); | |||
assOrderinfoRepo.persist(assOrderinfo); | |||
assVehicleRelieveRepo.persist(assVehicleRelieve); | |||
} |
@@ -2,6 +2,7 @@ package cn.com.taiji.ias.manager.order; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.core.entity.basic.QtkBrandInfo; | |||
import cn.com.taiji.core.entity.dict.basic.CardType; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import cn.com.taiji.core.entity.dict.issue.IssueOrderStatus; | |||
import cn.com.taiji.core.entity.dict.issue.IssueOrderStep; | |||
@@ -81,17 +82,11 @@ public class OrderAuditManager extends AbstractOrderManager<OrderAuditRequest> { | |||
//审核通过 | |||
if (SourceType.CHANNEL.equals(order.getOrderSource())) { | |||
//20250408修改,线上不需要支付,审核通过直接待签约 | |||
if (order.getPromotionModes().equals(1)) {// 线上 | |||
order.setOrderStep(IssueOrderStep.ORDER_PAID);//待签约 | |||
} else if (order.getPromotionModes().equals(2)) {//线下 | |||
if (order.getNeedPay()) {// 需要支付,指线下 | |||
order.setOrderStep(IssueOrderStep.VEHICLE_UPLOAD);//线下待支付 | |||
} else {//线上、线下 | |||
IssueProduct product = issueProductRepo.findByReleaseId(order.getProductId()); | |||
if (product.getNeedPay()) { | |||
order.setOrderStep(IssueOrderStep.VEHICLE_UPLOAD); | |||
} else { | |||
order.setOrderStep(IssueOrderStep.ORDER_PAID); | |||
} | |||
}else { | |||
//记账卡待签约,非记账卡待激活 | |||
order.setOrderStep(CardType.CHARGE_CARD.equals(order.getCardType())?IssueOrderStep.ORDER_PAID:IssueOrderStep.WAITING_ACTIVE); | |||
} | |||
} else { | |||
if (!ShippingStatus.NONE.equals(order.getShippingStatus())) {//需要邮寄 | |||
@@ -144,7 +139,11 @@ public class OrderAuditManager extends AbstractOrderManager<OrderAuditRequest> { | |||
//通知渠道 | |||
if (SourceType.CHANNEL.equals(order.getOrderSource())) { | |||
executor.execute(() -> { | |||
// qdCallUtil(order, ext) | |||
//需要支付通知已支付,不需要支付通知已签约 | |||
//审核时,既然可以走到待激活,那么肯定需要支付 | |||
if (CardType.CHARGE_CARD != order.getCardType() && IssueOrderStep.WAITING_ACTIVE.equals(order.getOrderStep())){ | |||
order.setOrderStep(IssueOrderStep.ORDER_SIGNED);////储值卡不需要支付且审核通过,通知已签约,其实库里状态是待激活 | |||
} | |||
qdCallUtil.callBackQd(order, req.getReason()); | |||
}); | |||
} |
@@ -145,7 +145,7 @@ public class OrderCancelManager extends AbstractOrderManager<OrderCancelRequest> | |||
} | |||
if (SourceType.CHANNEL.equals(order.getOrderSource())) {// 渠道订单的退款由自己完成 | |||
for (IssueOrderPay orderPay : pays) { | |||
if (OrderPayStatus.SUCCESS.equals(orderPay.getPayStatus())) { | |||
if (OrderPayStatus.SUCCESS.equals(orderPay.getPayStatus()) && !isEmpty(request.getRefundInfoList())) { | |||
for (RetunInfoModel retunInfoModel : request.getRefundInfoList()) { | |||
if (retunInfoModel.getPayOrderNo().equals(orderPay.getPayOrderNo())) { | |||
orderPay.setRefundAmount(retunInfoModel.getRefundAmount()); |
@@ -26,6 +26,7 @@ import java.util.stream.Collectors; | |||
/** | |||
* <pre> | |||
* 订单支付查询 | |||
* //渠道订单不需要支付,就不会到此步进行查询,即小程序不管怎样都会到这 | |||
* </pre> | |||
*/ | |||
@Service | |||
@@ -84,7 +85,18 @@ public class OrderPayQueryManager extends AbstractOrderManager<OrderPayQueryRequ | |||
@Override | |||
protected void onSuccessInternal(OrderPayQueryRequest req, ServiceLogEvent event, Map<String, Object> dataStream) throws ServiceHandleException { | |||
IssueOrderinfo order = (IssueOrderinfo)dataStream.get(ORDER); | |||
asyCallBackQd(order, ""); | |||
if (SourceType.CHANNEL.equals(order.getOrderSource())) { | |||
List<IssueOrderPay> orderPays = (List<IssueOrderPay>) dataStream.get(ORDERPAY); | |||
boolean b = orderPays.stream().anyMatch(pay -> !pay.getPayStatus().equals(OrderPayStatus.SUCCESS)); | |||
if (order.getNeedPay() && !b) { | |||
//需要支付通知已支付,不需要支付通知已签约 | |||
//支付时,既然可以走到待激活,那么肯定需要支付 | |||
if (CardType.CHARGE_CARD != order.getCardType()) { | |||
order.setOrderStep(IssueOrderStep.ORDER_PAID);//储值卡支付完成,通知已支付,其实库里状态是待激活 | |||
} | |||
asyCallBackQd(order, ""); | |||
} | |||
} | |||
} | |||
@Override |
@@ -130,6 +130,11 @@ public class VehicleUploadManager extends AbstractOrderManager<VehicleUploadRequ | |||
dataStream.put(ORDER_EXT, ext); | |||
//回调通知渠道 | |||
if (SourceType.CHANNEL.equals(order.getOrderSource())) { | |||
if (CardType.CHARGE_CARD != order.getCardType() && IssueOrderStep.WAITING_ACTIVE.equals(order.getOrderStep())){ | |||
//需要支付通知已支付,不需要支付通知已签约 | |||
//车辆信息上传时,既然可以走到待激活,那么肯定不需要支付 | |||
order.setOrderStep(IssueOrderStep.ORDER_SIGNED);////储值卡不需要支付且审核通过,通知已签约,其实库里状态是待激活 | |||
} | |||
asyCallBackQd(order, ext.getCancelReason()); | |||
} | |||
} | |||
@@ -342,13 +347,14 @@ public class VehicleUploadManager extends AbstractOrderManager<VehicleUploadRequ | |||
// 是否被人工审核 1:人工 2:系统 0:未审核。人工审核时再变成1 | |||
order.setArtificialStatus(2); | |||
if (SourceType.CHANNEL.equals(order.getOrderSource())) { | |||
if (order.getVanType() !=1){ //非客车 都需要审核 | |||
if (order.getVanType() !=1 || hasText(failReason)){ //非客车或审核不通过 都需要审核 | |||
order.setOrderStep(IssueOrderStep.WAITING_AUDIT); | |||
}else { | |||
if (!hasText(failReason)) { | |||
order.setOrderStep(IssueOrderStep.VEHICLE_UPLOAD);//待支付 | |||
} else { | |||
order.setOrderStep(IssueOrderStep.WAITING_AUDIT); | |||
if (order.getNeedPay()) {// 需要支付,指线下 | |||
order.setOrderStep(IssueOrderStep.VEHICLE_UPLOAD);//线下待支付 | |||
}else { | |||
//记账卡待签约,非记账卡待激活 | |||
order.setOrderStep(CardType.CHARGE_CARD.equals(order.getCardType())?IssueOrderStep.ORDER_PAID:IssueOrderStep.WAITING_ACTIVE); | |||
} | |||
} | |||
} else { |
@@ -42,7 +42,7 @@ public class RegisterNoCodeManager extends AbstractLoginManager implements LogMa | |||
if (hasText(request.getIdNum()) && request.getIdType() != null) { | |||
accountInfo = accountInfoRepo.findByIdNumAndIdType(request.getIdNum(), request.getIdType()); | |||
if (accountInfo != null) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该用户已存在实名账号"); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("证件号已绑定"+accountInfo.getMobile()); | |||
} | |||
accountInfo = from(request); | |||
accountInfoRepo.persist(accountInfo); |
@@ -61,7 +61,9 @@ public class YgzCardUploadManager extends AbstractCommNioManager implements LogM | |||
// 调用nio接口 | |||
CardUploadNioResponse nioResponse = (CardUploadNioResponse) sendRequest(nioRequest, CardUploadNioResponse.class); | |||
// 处理返回值 | |||
if (nioResponse == null) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio接口返回值为空"); | |||
if (nioResponse == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio传输错误,返回值为空"); | |||
} | |||
// 成功 | |||
if (nioResponse.getStatusCode().equals("200")) { | |||
saveDaspOfflineData(request.toJson(), request.getCard().getCardId(), request.getOperation(), OfflineSendType.CARD_UPLOAD); | |||
@@ -99,8 +101,12 @@ public class YgzCardUploadManager extends AbstractCommNioManager implements LogM | |||
response.setMsg(errorMsg); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, errorMsg); | |||
} catch (Exception e) { | |||
if (request.isSync()) throw e; | |||
throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
logger.error("YGZ系统异常:", e); | |||
if (request.isSync()) throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
YgzCardUploadResponse response = new YgzCardUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg(e.getMessage()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, e.getMessage()); | |||
} | |||
} | |||
@@ -61,6 +61,9 @@ public class YgzObuUploadManager extends AbstractCommNioManager implements LogMa | |||
nioRequest.setInstallChannelId(agencyChannelMapperManager.mapChannelId(nioRequest.getInstallChannelId())); | |||
// 调用nio接口 | |||
ObuUploadNioResponse nioResponse = (ObuUploadNioResponse) sendRequest(nioRequest, ObuUploadNioResponse.class); | |||
if (nioResponse == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio传输错误,返回值为空"); | |||
} | |||
// 成功 | |||
if (nioResponse.getStatusCode().equals("200")) { | |||
saveDaspOfflineData(request.toJson(), request.getObu().getObuId(), request.getOperation(), OfflineSendType.OBU_UPLOAD); | |||
@@ -99,9 +102,13 @@ public class YgzObuUploadManager extends AbstractCommNioManager implements LogMa | |||
response.setSuccess(false); | |||
response.setMsg(errorMsg); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, errorMsg); | |||
} catch (Exception e) { | |||
if (request.isSync()) throw e; | |||
throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
} catch (Exception e) { | |||
logger.error("YGZ系统异常:", e); | |||
if (request.isSync()) throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
YgzObuUploadResponse response = new YgzObuUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg(e.getMessage()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, e.getMessage()); | |||
} | |||
} | |||
@@ -35,6 +35,9 @@ public class YgzUserUploadManager extends AbstractCommNioManager implements LogM | |||
nioRequest.setChannelId(agencyChannelMapperManager.mapChannelId(nioRequest.getChannelId())); | |||
// 调用nio接口 | |||
UserUploadNioResponse nioResponse = (UserUploadNioResponse) sendRequest(nioRequest, UserUploadNioResponse.class); | |||
if (nioResponse == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio传输错误,返回值为空"); | |||
} | |||
// 成功 | |||
if (nioResponse.getStatusCode().equals("200")) { | |||
saveDaspOfflineData(request.toJson(), request.getCustomer().getCustomerId(), request.getOperation(), OfflineSendType.USER_UPLOAD); | |||
@@ -48,7 +51,6 @@ public class YgzUserUploadManager extends AbstractCommNioManager implements LogM | |||
return serviceHandle(request); | |||
} | |||
if (errorMsg.contains("已存在") && request.getOperation() == Operation.ADD) {// 重发一次 | |||
// 更新时返回错误 用户不存在 需要上传新增用户 | |||
request.setOperation(Operation.UPDATE); | |||
return serviceHandle(request); | |||
} | |||
@@ -57,8 +59,12 @@ public class YgzUserUploadManager extends AbstractCommNioManager implements LogM | |||
response.setMsg(errorMsg); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, errorMsg); | |||
} catch (Exception e) { | |||
if (request.isSync()) throw e; | |||
throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
logger.error("YGZ系统异常:", e); | |||
if (request.isSync()) throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
YgzUserUploadResponse response = new YgzUserUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg(e.getMessage()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, e.getMessage()); | |||
} | |||
} | |||
@@ -9,10 +9,7 @@ import cn.com.taiji.core.entity.dict.ygz.Operation; | |||
import cn.com.taiji.core.entity.dict.ygz.QtkServiceType; | |||
import cn.com.taiji.core.entity.log.YgzInterfaceLog; | |||
import cn.com.taiji.core.manager.comm.LogManager; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzServiceCmd; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzUserUploadRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzVehicleUploadRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzVehicleUploadResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.ygz.*; | |||
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkCustomerInfoRepo; | |||
import cn.com.taiji.ias.manager.ygz.nio.AbstractCommNioManager; | |||
@@ -46,6 +43,9 @@ public class YgzVehicleUploadManager extends AbstractCommNioManager implements L | |||
nioRequest.setChannelId(agencyChannelMapperManager.mapChannelId(nioRequest.getChannelId())); | |||
// 调用nio接口 | |||
VehicleUploadNioResponse nioResponse = (VehicleUploadNioResponse) sendRequest(nioRequest, VehicleUploadNioResponse.class); | |||
if (nioResponse == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Nio传输错误,返回值为空"); | |||
} | |||
// 成功 | |||
if (nioResponse.getStatusCode().equals("200")) { | |||
saveDaspOfflineData(request.toJson(), request.getVehicle().getVehicleId(), request.getOperation(), OfflineSendType.VEHICLE_UPLOAD); | |||
@@ -82,8 +82,12 @@ public class YgzVehicleUploadManager extends AbstractCommNioManager implements L | |||
response.setMsg(errorMsg); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, errorMsg); | |||
} catch (Exception e) { | |||
if (request.isSync()) throw e; | |||
throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
logger.error("YGZ系统异常:", e); | |||
if (request.isSync()) throw exception(request, YgzInterfaceLog.class, e.getMessage()); | |||
YgzVehicleUploadResponse response = new YgzVehicleUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg(e.getMessage()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, e.getMessage()); | |||
} | |||
} | |||
@@ -6,6 +6,7 @@ import cn.com.taiji.core.entity.dict.basic.CardStatus; | |||
import cn.com.taiji.core.entity.dict.basic.DeviceVersion; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import cn.com.taiji.core.entity.dict.invw.InvDeviceStatus; | |||
import cn.com.taiji.core.entity.dict.issue.IssueOrderStatus; | |||
import cn.com.taiji.core.entity.dict.issue.IssueOrderStep; | |||
import cn.com.taiji.core.entity.invw.InvwCardDetails; | |||
import cn.com.taiji.core.entity.invw.InvwObuDetails; | |||
@@ -107,7 +108,8 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In | |||
} | |||
private void businessValidate(IssueOrderinfo orderInfo, InstApplyRequest req) throws ServiceHandleException { | |||
if (IssueOrderStep.ACTIVED == orderInfo.getOrderStep() && IssueOrderStatus.ACTIVE == orderInfo.getOrderStatus()) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("当前订单[" + orderInfo.getOrderNo() + "]已激活成功,请勿重复提交!"); | |||
if (IssueOrderStep.WAITING_ACTIVE != orderInfo.getOrderStep()) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("订单当前状态不可激活"); | |||
} | |||
@@ -188,6 +190,8 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In | |||
if (req.getObuVersion() == 48 || req.getObuVersion() == 52) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("专项作业车不能发行单片式OBU"); | |||
} | |||
if (!orderInfo.getProtocol().equals("1")) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该订单未签署协议,无法激活"); | |||
// 线上模式上传安装照校验 | |||
IssueOrderinfoExt orderinfoExt = orderinfoExtRepo.findByOrderNo(orderInfo.getOrderNo()); | |||
if (orderinfoExt == null) { | |||
@@ -195,12 +199,6 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In | |||
} else if (orderInfo.getPromotionModes() == 1 && !hasText(orderinfoExt.getInstallImgUrl())) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("线上模式需要上传设备安装照"); | |||
} | |||
// 线上模式渠道订单发货信息校验 | |||
if (orderInfo.getOrderSource() == SourceType.CHANNEL && orderInfo.getPromotionModes() == 1) { | |||
CsmsnConsignee csmsnConsignee = csmsnConsigneeRepo.findByObuId(orderInfo.getObuId()); | |||
if (csmsnConsignee == null) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("线上模式渠道需要上传发货信息"); | |||
} | |||
//渠道校验 | |||
if (SourceType.CHANNEL == orderInfo.getOrderSource()) { | |||
orderInfo.setCardId(req.getCardId());//渠道验证用,不做持久化 | |||
@@ -213,7 +211,12 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("渠道反馈不可激活:" + noticeResponse.getFailReason()); | |||
} | |||
} | |||
// 线上模式渠道订单发货信息校验 | |||
if (orderInfo.getOrderSource() == SourceType.CHANNEL && orderInfo.getPromotionModes() == 1) { | |||
CsmsnConsignee csmsnConsignee = csmsnConsigneeRepo.findByObuId(orderInfo.getObuId()); | |||
if (csmsnConsignee == null) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("线上模式渠道需要上传发货信息"); | |||
} | |||
} | |||
@Override |
@@ -228,6 +228,16 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("当前签不在库存中"); | |||
} | |||
} | |||
if (vo.isValidOrder()) { | |||
IssueOrderinfo orderInfo = orderInfoRepo.findByOrderNo(vo.getOrderId()); | |||
if (IssueOrderStep.ACTIVED == orderInfo.getOrderStep() && IssueOrderStatus.ACTIVE == orderInfo.getOrderStatus()) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("当前订单[" + orderInfo.getOrderNo() + "]已激活成功,请勿重复提交!"); | |||
if (IssueOrderStep.WAITING_ACTIVE != orderInfo.getOrderStep()) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("订单当前状态不可激活"); | |||
} | |||
if (!orderInfo.getProtocol().equals("1")) | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该订单未签署协议,无法激活"); | |||
} | |||
} | |||
@Override |