Bladeren bron

注销修改

master
yangpeilai 15 uur geleden
bovenliggende
commit
49c3f4c67a

+ 2
- 1
gly-base-core/src/main/java/cn/com/taiji/core/entity/dict/log/OperateType.java Bestand weergeven

@@ -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("设备注销申审核"),

+ 2
- 0
gly-base-core/src/main/java/cn/com/taiji/core/model/comm/protocol/inss/InssServiceType.java Bestand weergeven

@@ -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

+ 1
- 1
gly-base-core/src/main/java/cn/com/taiji/core/model/comm/protocol/inss/deviceCancel/DeviceCancelInstServiceCmd.java Bestand weergeven

@@ -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) {

+ 13
- 7
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/api/ass/DeviceCancelController.java Bestand weergeven

@@ -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));
}

}

+ 22
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/ass/device/DeviceCancelInstApplyRequestDTO.java Bestand weergeven

@@ -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;
}

zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/ass/device/DeviceCancelInstRequestDTO.java → zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/ass/device/DeviceCancelInstCallBackRequestDTO.java Bestand weergeven

@@ -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

+ 3
- 1
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/ass/DeviceCancelManager.java Bestand weergeven

@@ -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;
}

+ 42
- 7
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/ass/DeviceCancelManagerImpl.java Bestand weergeven

@@ -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);
}
}

+ 1
- 1
zhywpt-service-inss/src/main/java/cn/com/taiji/inss/manager/handler/DeviceCancelInstServiceHandler.java Bestand weergeven

@@ -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

Laden…
Annuleren
Opslaan