@@ -173,7 +173,8 @@ public enum OperateType { | |||
// 设备注销 | |||
DEVICE_CANCEL_QUERY("设备注销申请"), | |||
DEVICE_CANCEL_APPLY("设备注销申请"), | |||
DEVICE_CANCEL_APPLY_CONFIRM("设备注销申请确认"), | |||
DEVICE_CANCEL_APPLY_INST_APPLY("设备注销指令初始化"), | |||
DEVICE_CANCEL_APPLY_INST_CALLBACK("设备注销指令回传"), | |||
DEVICE_CANCEL_APPLY_PAY("设备注销申请违约金支付"), | |||
DEVICE_CANCEL_APPLY_PAY_QUERY("设备注销申请违约金支付查询"), | |||
DEVICE_CANCEL_APPLY_AUDIT("设备注销申审核"), |
@@ -4,6 +4,7 @@ import cn.com.taiji.core.manager.comm.client.CommServiceCommand; | |||
import cn.com.taiji.core.model.comm.protocol.SignServiceCommand; | |||
import cn.com.taiji.core.model.comm.protocol.SignServiceSystem; | |||
import cn.com.taiji.core.model.comm.protocol.SignServiceType; | |||
import cn.com.taiji.core.model.comm.protocol.inss.deviceCancel.DeviceCancelInstServiceCmd; | |||
import cn.com.taiji.core.model.comm.protocol.inss.inst.InstServiceCmd; | |||
import cn.com.taiji.core.model.comm.protocol.inss.renewalInst.RenewalInstServiceCmd; | |||
import cn.com.taiji.core.model.comm.protocol.inss.vfj.VfjServiceCmd; | |||
@@ -18,6 +19,7 @@ public enum InssServiceType implements SignServiceType { | |||
VFJ("VFJ操作", "^VFJ_\\S+\\.json$", VfjServiceCmd.values()), | |||
INST("指令接口", "^INST_\\S+\\.json$", InstServiceCmd.values()), | |||
RENEWALINST("续期指令接口", "^RENEWALINST_\\S+\\.json$", RenewalInstServiceCmd.values()), | |||
DEVICECANCEL("注销指令接口", "^DEVICECANCEL_\\S+\\.json$", DeviceCancelInstServiceCmd.values()), | |||
; | |||
@Getter |
@@ -20,7 +20,7 @@ public enum DeviceCancelInstServiceCmd implements SignServiceCommand { | |||
@Override | |||
public SignServiceType getServiceType() { | |||
return InssServiceType.RENEWALINST; | |||
return InssServiceType.DEVICECANCEL; | |||
} | |||
public static DeviceCancelInstServiceCmd fromIfCode(String ifCode) { |
@@ -37,16 +37,22 @@ public class DeviceCancelController extends MyValidController { | |||
return ApiResponse.of(manager.apply(reqDto)); | |||
} | |||
@ApiOperation(value = "03-获取指令") | |||
@PostMapping(value = "/getInst") | |||
public ApiResponse<DeviceCancelInstResponseDTO> getInst(@Valid @RequestBody DeviceCancelInstRequestDTO reqDto) throws ManagerException { | |||
return ApiResponse.of(manager.getInst(reqDto)); | |||
} | |||
@ApiOperation(value = "04-获取二维码 APP") | |||
@ApiOperation(value = "03-获取二维码 APP") | |||
@PostMapping(value = "/getQrCode") | |||
public ApiResponse<ListQrCodeResDTO> getQrCode(@Valid @RequestBody ListQrCodeReqDTO reqDto) throws ManagerException { | |||
return ApiResponse.of(manager.getQrCode(reqDto)); | |||
} | |||
@ApiOperation(value = "04-指令初始化") | |||
@PostMapping(value = "/instApply") | |||
public ApiResponse<DeviceCancelInstResponseDTO> instApply(@Valid @RequestBody DeviceCancelInstApplyRequestDTO reqDto) throws ManagerException { | |||
return ApiResponse.of(manager.instApply(reqDto)); | |||
} | |||
@ApiOperation(value = "05-获取指令") | |||
@PostMapping(value = "/instCallBack") | |||
public ApiResponse<DeviceCancelInstResponseDTO> instCallBack(@Valid @RequestBody DeviceCancelInstCallBackRequestDTO reqDto) throws ManagerException { | |||
return ApiResponse.of(manager.instCallBack(reqDto)); | |||
} | |||
} |
@@ -0,0 +1,22 @@ | |||
package cn.com.taiji.iaw.dto.ass.device; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
@Getter | |||
@Setter | |||
@ApiModel(description = "获取读写指令") | |||
public class DeviceCancelInstApplyRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "卡号") | |||
private String cardId; | |||
@ApiModelProperty(value = "签号") | |||
private String obuId; | |||
} |
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotNull; | |||
@Getter | |||
@Setter | |||
@ApiModel(description = "获取读写指令") | |||
public class DeviceCancelInstRequestDTO extends AbstractBizRequestDTO { | |||
public class DeviceCancelInstCallBackRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "指令编号", required = true) | |||
@NotBlank |
@@ -12,5 +12,7 @@ public interface DeviceCancelManager { | |||
ListQrCodeResDTO getQrCode(ListQrCodeReqDTO reqDto) throws ManagerException; | |||
DeviceCancelInstResponseDTO getInst(DeviceCancelInstRequestDTO reqDto) throws ManagerException; | |||
DeviceCancelInstResponseDTO instApply(DeviceCancelInstApplyRequestDTO reqDto) throws ManagerException; | |||
DeviceCancelInstResponseDTO instCallBack(DeviceCancelInstCallBackRequestDTO reqDto) throws ManagerException; | |||
} |
@@ -1,6 +1,8 @@ | |||
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.core.dto.AbstractBizRequestDTO; | |||
import cn.com.taiji.core.entity.ass.AssOrderinfo; | |||
import cn.com.taiji.core.entity.basic.QtkCardInfo; | |||
import cn.com.taiji.core.entity.basic.QtkCustomerInfo; | |||
@@ -23,6 +25,8 @@ import cn.com.taiji.core.model.comm.protocol.ias.ass.CommDeviceCancelApplyRespon | |||
import cn.com.taiji.core.model.comm.protocol.ias.ass.DeviceCancelApplyRequest; | |||
import cn.com.taiji.core.model.comm.protocol.inss.deviceCancel.DeviceCancelInstApplyRequest; | |||
import cn.com.taiji.core.model.comm.protocol.inss.deviceCancel.DeviceCancelInstApplyResponse; | |||
import cn.com.taiji.core.model.comm.protocol.inss.deviceCancel.DeviceCancelInstCallBackRequest; | |||
import cn.com.taiji.core.model.comm.protocol.inss.deviceCancel.DeviceCancelInstCallBackResponse; | |||
import cn.com.taiji.core.model.comm.protocol.msgw.send.MsgwWxMpSendRequest; | |||
import cn.com.taiji.core.repo.jpa.ass.AssOrderinfoRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo; | |||
@@ -195,7 +199,7 @@ public class DeviceCancelManagerImpl extends AbstractIawManager implements Devic | |||
cardBlackRequest.setStatus(1); | |||
CardQueryResponse cardQueryResponse = jsonPostRepeat(cardBlackRequest); | |||
if (cardQueryResponse.getResults() != null && cardQueryResponse.getResults().size() > 0) { | |||
flag=true; | |||
flag = true; | |||
sb.append("卡存在黑名单,"); | |||
} | |||
@@ -204,7 +208,7 @@ public class DeviceCancelManagerImpl extends AbstractIawManager implements Devic | |||
obuBlackRequest.setStatus(1); | |||
ObuQueryResponse obuQueryResponse = jsonPostRepeat(obuBlackRequest); | |||
if (obuQueryResponse.getResults() != null && obuQueryResponse.getResults().size() > 0) { | |||
flag=true; | |||
flag = true; | |||
sb.append("签存在黑名单,"); | |||
} | |||
return flag; | |||
@@ -254,7 +258,7 @@ public class DeviceCancelManagerImpl extends AbstractIawManager implements Devic | |||
@Override | |||
public ListQrCodeResDTO getQrCode(ListQrCodeReqDTO reqDto) throws ManagerException { | |||
if(!SourceType.SERVICE_HALL.equals(reqDto.getOrderSource())){ | |||
if (!SourceType.SERVICE_HALL.equals(reqDto.getOrderSource())) { | |||
throw new ManagerException("来源非法!"); | |||
} | |||
AssOrderinfo order = orderInfoRepo.findByOrderNo(reqDto.getOrderNo()); | |||
@@ -296,12 +300,43 @@ public class DeviceCancelManagerImpl extends AbstractIawManager implements Devic | |||
} | |||
@Override | |||
public DeviceCancelInstResponseDTO getInst(DeviceCancelInstRequestDTO reqDto) throws ManagerException { | |||
public DeviceCancelInstResponseDTO instApply(DeviceCancelInstApplyRequestDTO reqDto) throws ManagerException { | |||
DeviceCancelInstApplyRequest request = copyProperties(reqDto, new DeviceCancelInstApplyRequest()); | |||
DeviceCancelInstApplyResponse response = jsonPostRepeat(request); | |||
if (response == null) { | |||
try { | |||
DeviceCancelInstApplyResponse response = jsonPostRepeat(request); | |||
if (response == null) { | |||
saveLog(OperateType.DEVICE_CANCEL_APPLY_INST_APPLY, "-1", reqDto, "失败"); | |||
throw new ManagerException("获取指令出错,请重试"); | |||
} | |||
saveLog(OperateType.DEVICE_CANCEL_APPLY_INST_APPLY, response.getTransOrderId(), reqDto, "成功"); | |||
return copyProperties(response, new DeviceCancelInstResponseDTO()); | |||
} catch (Exception e) { | |||
logger.error("获取指令出错", e); | |||
saveLog(OperateType.DEVICE_CANCEL_APPLY_INST_APPLY, "-1", reqDto, "失败"); | |||
throw new ManagerException("获取指令出错,请重试"); | |||
} | |||
} | |||
@Override | |||
public DeviceCancelInstResponseDTO instCallBack(DeviceCancelInstCallBackRequestDTO reqDto) throws ManagerException { | |||
DeviceCancelInstCallBackRequest request = copyProperties(reqDto, new DeviceCancelInstCallBackRequest()); | |||
try { | |||
DeviceCancelInstCallBackResponse response = jsonPostRepeat(request); | |||
if (response == null) { | |||
saveLog(OperateType.DEVICE_CANCEL_APPLY_INST_CALLBACK, "-1", reqDto, "失败"); | |||
throw new ManagerException("获取指令出错,请重试"); | |||
} | |||
saveLog(OperateType.DEVICE_CANCEL_APPLY_INST_CALLBACK, response.getTransOrderId(), reqDto, "成功"); | |||
return copyProperties(response, new DeviceCancelInstResponseDTO()); | |||
} catch (Exception e) { | |||
logger.error("获取指令出错", e); | |||
saveLog(OperateType.DEVICE_CANCEL_APPLY_INST_CALLBACK, "-1", reqDto, "失败"); | |||
throw new ManagerException("获取指令出错,请重试"); | |||
} | |||
return copyProperties(response, new DeviceCancelInstResponseDTO()); | |||
} | |||
public void saveLog(OperateType operateType, String dataId, AbstractBizRequestDTO reqDto, String msg) throws ManagerException { | |||
//记录日志 | |||
persistOperateLog(operateType, hasText(dataId) ? dataId : "-1", reqDto.getOrderSource(), findOpenIdByToken(reqDto.getAccessToken()), "注销获取指令" + msg); | |||
} | |||
} |
@@ -18,7 +18,7 @@ import org.springframework.stereotype.Service; | |||
@Service | |||
public class DeviceCancelInstServiceHandler extends AbstractInssServiceHandler<DeviceCancelInstServiceCmd> { | |||
public DeviceCancelInstServiceHandler() { | |||
super(InssServiceType.RENEWALINST); | |||
super(InssServiceType.DEVICECANCEL); | |||
} | |||
@Autowired |