parent
32cdcbbac4
commit
5b7f390e73
|
@ -10,6 +10,8 @@ import com.dispose.pojo.po.DisposeDeviceCapacity;
|
|||
import com.dispose.pojo.po.MulReturnType;
|
||||
import com.dispose.pojo.vo.haohan.CleanReq;
|
||||
import com.dispose.pojo.vo.haohan.CleanRsp;
|
||||
import com.dispose.pojo.vo.haohan.CommonRsp;
|
||||
import com.dispose.pojo.vo.haohan.StopCleanReq;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -102,7 +104,36 @@ public class HaoHanImpl implements DisposeEntryManager {
|
|||
*/
|
||||
@Override
|
||||
public MulReturnType<ErrorCode, Long> stopDispose(String ipAddr, DeviceCapacity type, Long devTaskId) {
|
||||
return new MulReturnType<>(ErrorCode.ERR_OK, null);
|
||||
StopCleanReq req = StopCleanReq.builder()
|
||||
.cleanTaskId(devTaskId)
|
||||
.orderFrom("China Mobile")
|
||||
.build();
|
||||
|
||||
log.info("++++Begging Haohan Stop Cleanup Task: {}", devTaskId);
|
||||
|
||||
try{
|
||||
String ret = Http.postJson(deviceAddress + "/delTow",
|
||||
null,
|
||||
objectMapper.writeValueAsString(req));
|
||||
|
||||
CommonRsp rsp = objectMapper.readValue(ret, CommonRsp.class);
|
||||
|
||||
if (rsp == null) {
|
||||
log.error("----Error Haohan stop task{} server return error", devTaskId);
|
||||
return new MulReturnType<>(ErrorCode.ERR_HAOHAN_ERROR, null);
|
||||
}
|
||||
|
||||
if (rsp.getState() != ErrorCode.ERR_OK.getCode()) {
|
||||
log.error("----Error Haohan stop task {} return error: {}, {}", devTaskId, rsp.getState(), rsp.getMsg());
|
||||
return new MulReturnType<>(ErrorCode.ERR_HAOHAN_ERROR, null);
|
||||
}
|
||||
|
||||
log.info("----Finish Haohan Stop Cleanup Task: {}", devTaskId);
|
||||
return new MulReturnType<>(ErrorCode.ERR_OK, null);
|
||||
}catch (JsonProcessingException e) {
|
||||
log.error("----Error Haohan Stop Cleanup Task: {}", devTaskId);
|
||||
return new MulReturnType<>(ErrorCode.ERR_SYSTEMEXCEPTION, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -171,7 +171,6 @@ public class TaskInfoMapperTest extends InitTestEnvironment {
|
|||
taskInfo.getId(), taskInfo.getStatus(), changeStatus);
|
||||
|
||||
taskInfoMapper.changeTaskInfoStatus(taskInfo.getId(), changeStatus);
|
||||
|
||||
Assert.assertNotEquals(beforeStatus, new Long((long) taskInfoMapper.getTaskInfoCurrentStatus(taskInfo.getId())));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue