@ApiModelProperty(value = "车牌颜色") | @ApiModelProperty(value = "车牌颜色") | ||||
private String vehiclePlateColor;//车牌颜色; | private String vehiclePlateColor;//车牌颜色; | ||||
@ApiModelProperty(value = "挂失类型 1-挂失 2-解挂") | |||||
@StringConstant(values ="1, 2", message = "挂失类型只能是1或2") | |||||
@ApiModelProperty(value = "挂失类型 1-挂失 2-解挂 null-全部") | |||||
@StringConstant(values ="1,2", message = "挂失类型只能是1或2") | |||||
private String lossType;//挂失类型; | private String lossType;//挂失类型; | ||||
@Override | @Override |
package cn.com.taiji.managew.dto.ass; | package cn.com.taiji.managew.dto.ass; | ||||
import cn.com.taiji.common.valid.ViolationValidator; | import cn.com.taiji.common.valid.ViolationValidator; | ||||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||||
import cn.com.taiji.core.entity.dict.basic.SourceType; | import cn.com.taiji.core.entity.dict.basic.SourceType; | ||||
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | ||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
@ApiModel(description = "卡签挂失解挂") | @ApiModel(description = "卡签挂失解挂") | ||||
@Getter | @Getter | ||||
@Setter | @Setter | ||||
public class AssDeviceLossReqDTO extends AbstractBizRequestDTO { | |||||
public class AssDeviceLossReqDTO extends AbstractStaffBizRequestDTO { | |||||
//业务类型 1-单卡挂失 2-单签挂失 3-卡签挂失 4-单卡解挂 5-单签解挂 6-卡签解挂 | //业务类型 1-单卡挂失 2-单签挂失 3-卡签挂失 4-单卡解挂 5-单签解挂 6-卡签解挂 | ||||
@ApiModelProperty(value = "业务类型", required = true) | @ApiModelProperty(value = "业务类型", required = true) | ||||
@ApiModelProperty(value = "行驶证反面") | @ApiModelProperty(value = "行驶证反面") | ||||
private String vehNegImgUrl; | private String vehNegImgUrl; | ||||
//员工Id | |||||
@ApiModelProperty(value = "员工Id") | |||||
private String staffId; | |||||
@Override | @Override | ||||
protected void validate(ViolationValidator validator) { | protected void validate(ViolationValidator validator) { | ||||
super.validate(validator); | super.validate(validator); | ||||
validator.addViolation("loginSource", "登录来源有误"); | validator.addViolation("loginSource", "登录来源有误"); | ||||
} | } | ||||
if (getOrderSource() == SourceType.SERVICE_HALL) { | if (getOrderSource() == SourceType.SERVICE_HALL) { | ||||
validator.validFieldNotBlank("staffId", staffId); | |||||
validator.validFieldNotBlank("vehPosImgUrl", vehPosImgUrl); | validator.validFieldNotBlank("vehPosImgUrl", vehPosImgUrl); | ||||
validator.validFieldNotBlank("vehNegImgUrl", vehNegImgUrl); | validator.validFieldNotBlank("vehNegImgUrl", vehNegImgUrl); | ||||
} | } | ||||
if (getOrderSource() == SourceType.WEB){ | |||||
validator.validFieldNotBlank("staffId", staffId); | |||||
} | |||||
} | } | ||||
} | } |
} | } | ||||
logger.info("=>返回结果:订单号{},状态码{},状态信息{}",response.getOrderNo(), response.getCode(),response.getMsg()); | logger.info("=>返回结果:订单号{},状态码{},状态信息{}",response.getOrderNo(), response.getCode(),response.getMsg()); | ||||
// 保存日志操作日志 | |||||
persistOperateLog(operateType, response.getOrderNo(), source, findOpenIdByToken(reqDto.getAccessToken()), "挂失解挂操作" + response.getMsg()); | |||||
if (!"1".equals(response.getCode())) { | if (!"1".equals(response.getCode())) { | ||||
throw new ManagerException("出错了", response.getMsg()); | |||||
throw new ManagerException("出错了"+response.getMsg()); | |||||
} | } | ||||
// 保存日志操作日志,失败不计入日志 | |||||
persistOperateLog(operateType, response.getOrderNo(), source, findOpenIdByToken(reqDto.getAccessToken()), "挂失解挂操作" + response.getMsg()); | |||||
} | } | ||||
@Override | @Override | ||||
if (hasText(reqDto.getVehiclePlate()) && hasText(reqDto.getVehiclePlateColor())) { | if (hasText(reqDto.getVehiclePlate()) && hasText(reqDto.getVehiclePlateColor())) { | ||||
request.setVehicleId(reqDto.getVehiclePlate() + "_" + reqDto.getVehiclePlate()); | request.setVehicleId(reqDto.getVehiclePlate() + "_" + reqDto.getVehiclePlate()); | ||||
} | } | ||||
List<AssOrderType> orderTypes = new ArrayList<>(); | |||||
if (hasText(reqDto.getLossType())) { | if (hasText(reqDto.getLossType())) { | ||||
List<AssOrderType> orderTypes = new ArrayList<>(); | |||||
//1-挂失,2-解挂 | //1-挂失,2-解挂 | ||||
if ("1".equals(reqDto.getLossType())) { | if ("1".equals(reqDto.getLossType())) { | ||||
orderTypes.add(AssOrderType.LOSS); | orderTypes.add(AssOrderType.LOSS); | ||||
orderTypes.add(AssOrderType.CARD_RELEASE_LOSS); | orderTypes.add(AssOrderType.CARD_RELEASE_LOSS); | ||||
orderTypes.add(AssOrderType.OBU_RELEASE_LOSS); | orderTypes.add(AssOrderType.OBU_RELEASE_LOSS); | ||||
} | } | ||||
request.setOrderTypes(orderTypes); | |||||
}else { | |||||
orderTypes.add(AssOrderType.LOSS); | |||||
orderTypes.add(AssOrderType.CARD_LOSS); | |||||
orderTypes.add(AssOrderType.OBU_LOSS); | |||||
orderTypes.add(AssOrderType.RELEASE_LOSS); | |||||
orderTypes.add(AssOrderType.CARD_RELEASE_LOSS); | |||||
orderTypes.add(AssOrderType.OBU_RELEASE_LOSS); | |||||
} | } | ||||
request.setOrderTypes(orderTypes); | |||||
return orderInfoRepo.page(request).convertResult(this::toModel); | return orderInfoRepo.page(request).convertResult(this::toModel); | ||||
} | } | ||||
v2Request.setBody(orderPay.getPayType().getValue()); | v2Request.setBody(orderPay.getPayType().getValue()); | ||||
v2Request.setOutTradeNo(orderPay.getPayOrderNo()); | v2Request.setOutTradeNo(orderPay.getPayOrderNo()); | ||||
v2Request.setTotalFee(orderPay.getFee().intValue()); | v2Request.setTotalFee(orderPay.getFee().intValue()); | ||||
v2Request.setSpbillCreateIp(req.getSpbillCreateIp()); | |||||
if (hasText(req.getSpbillCreateIp())) { | |||||
v2Request.setSpbillCreateIp(req.getSpbillCreateIp()); | |||||
}else { | |||||
v2Request.setSpbillCreateIp("127.0.0.1"); | |||||
} | |||||
v2Request.setNotifyUrl("https://skx.mynatapp.cc/qtucpaymgt/wxv3/notify/"); | v2Request.setNotifyUrl("https://skx.mynatapp.cc/qtucpaymgt/wxv3/notify/"); | ||||
v2Request.setTradeType(TradeType.valueOf(payConfig.getPayProductType())); | v2Request.setTradeType(TradeType.valueOf(payConfig.getPayProductType())); | ||||
v2Request.setOpenid(req.getSubOpenId()); | v2Request.setOpenid(req.getSubOpenId()); |
import cn.com.taiji.core.entity.dict.issue.IssueOrderStep; | import cn.com.taiji.core.entity.dict.issue.IssueOrderStep; | ||||
import cn.com.taiji.core.entity.dict.issue.ShippingStatus; | import cn.com.taiji.core.entity.dict.issue.ShippingStatus; | ||||
import cn.com.taiji.core.entity.issue.IssueOrderinfo; | import cn.com.taiji.core.entity.issue.IssueOrderinfo; | ||||
import cn.com.taiji.core.entity.issue.IssueOrderinfoExt; | |||||
import cn.com.taiji.core.model.comm.protocol.ats.weiXin.*; | import cn.com.taiji.core.model.comm.protocol.ats.weiXin.*; | ||||
import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryRequest; | import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryRequest; | ||||
import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryResponse; | import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryResponse; | ||||
import cn.com.taiji.core.model.comm.protocol.valid.ErrorMsgBuilder; | import cn.com.taiji.core.model.comm.protocol.valid.ErrorMsgBuilder; | ||||
import cn.com.taiji.core.repo.jpa.comm.CommonWxSignConfigRepo; | import cn.com.taiji.core.repo.jpa.comm.CommonWxSignConfigRepo; | ||||
import cn.com.taiji.core.repo.jpa.issue.IssueOrderinfoExtRepo; | |||||
import cn.com.taiji.ias.dict.DataType; | import cn.com.taiji.ias.dict.DataType; | ||||
import cn.com.taiji.ias.model.MyFinals; | import cn.com.taiji.ias.model.MyFinals; | ||||
import cn.com.taiji.ias.model.ServiceLogEvent; | import cn.com.taiji.ias.model.ServiceLogEvent; | ||||
public class SignQueryManager extends AbstractOrderManager<SignQueryRequest> { | public class SignQueryManager extends AbstractOrderManager<SignQueryRequest> { | ||||
public SignQueryManager() { | public SignQueryManager() { | ||||
super(DataType.SIGN_QUERY); | super(DataType.SIGN_QUERY); | ||||
} | } | ||||
Map<String, Object> dataStream) throws ServiceHandleException { | Map<String, Object> dataStream) throws ServiceHandleException { | ||||
IssueOrderinfo order = (IssueOrderinfo) dataStream.get(ORDER); | IssueOrderinfo order = (IssueOrderinfo) dataStream.get(ORDER); | ||||
Integer vehiclePlateColor = order.getVehiclePlateColor(); | Integer vehiclePlateColor = order.getVehiclePlateColor(); | ||||
IssueOrderinfoExt ext = orderInfoExtRepo.findByOrderNo(order.getOrderNo()); | |||||
switch (PlateColorType.valueOfCode(vehiclePlateColor)) { | switch (PlateColorType.valueOfCode(vehiclePlateColor)) { | ||||
case BLUE: | case BLUE: | ||||
case GREEN: | case GREEN: | ||||
carSignV2(request, order, dataStream); | |||||
carSignV2(request, order, dataStream,ext); | |||||
break; | break; | ||||
case YELLOW: | case YELLOW: | ||||
carSignV3(request, order,dataStream); | carSignV3(request, order,dataStream); | ||||
} | } | ||||
} | } | ||||
private void carSignV2(SignQueryRequest req, IssueOrderinfo order, Map<String, Object> dataStream) throws ServiceHandleException { | |||||
private void carSignV2(SignQueryRequest req, IssueOrderinfo order, Map<String, Object> dataStream,IssueOrderinfoExt ext) throws ServiceHandleException { | |||||
CommonWxSignConfig signConfig = commonWxSignConfigRepo.findByAgencyIdAndVersion(order.getAgencyId(), 2); | CommonWxSignConfig signConfig = commonWxSignConfigRepo.findByAgencyIdAndVersion(order.getAgencyId(), 2); | ||||
AtsVehicleUserStateRequest request = new AtsVehicleUserStateRequest(); | AtsVehicleUserStateRequest request = new AtsVehicleUserStateRequest(); | ||||
request.setAppId(signConfig.getAppId()); | request.setAppId(signConfig.getAppId()); | ||||
if (order.getOrderSource().equals(SourceType.CHANNEL)) { //渠道签约完成待激活 | if (order.getOrderSource().equals(SourceType.CHANNEL)) { //渠道签约完成待激活 | ||||
order.setOrderStep(IssueOrderStep.WAITING_ACTIVE); | order.setOrderStep(IssueOrderStep.WAITING_ACTIVE); | ||||
} else { | } else { | ||||
order.setOrderStep(ShippingStatus.WAIT_SHIPPING.equals(order.getShippingStatus()) ? | |||||
IssueOrderStep.WAITING_SEND : IssueOrderStep.WAITING_ACTIVE); | |||||
if (hasText(ext.getAuditReason())) { | |||||
order.setOrderStep(IssueOrderStep.WAITING_AUDIT); | |||||
}else { | |||||
order.setOrderStep(ShippingStatus.WAIT_SHIPPING.equals(order.getShippingStatus()) ? | |||||
IssueOrderStep.WAITING_SEND : IssueOrderStep.WAITING_ACTIVE); | |||||
} | |||||
} | } | ||||
dataStream.put(RES, new SignQueryResponse().setUserState(response.getUserState())); | dataStream.put(RES, new SignQueryResponse().setUserState(response.getUserState())); | ||||
} | } |