Commit daa4c44c authored by kongfm's avatar kongfm

接口测试修正

parent 4964e3de
package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.VoiceRecordFileServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.Calendar;
import java.util.List;
/**
......@@ -40,6 +40,9 @@ public class VoiceRecordFileController extends BaseController {
@Autowired
VoiceRecordFileServiceImpl voiceRecordFileServiceImpl;
@Autowired
AlertCalledServiceImpl iAlertCalledService;
/**
* 新增通话记录附件
*
......@@ -49,8 +52,23 @@ public class VoiceRecordFileController extends BaseController {
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增通话记录附件", notes = "新增通话记录附件")
public ResponseModel<VoiceRecordFileDto> save(@RequestBody VoiceRecordFileDto model) {
model = voiceRecordFileServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
if (ValidationUtil.isEmpty(model.getAlertId())
|| ValidationUtil.isEmpty(model.getTel())){
throw new BadRequest("参数校验失败.");
}
Calendar startTime = Calendar.getInstance();
Calendar endTime = Calendar.getInstance();
endTime.add(Calendar.MINUTE, 6);
model.setTelStartTime(startTime.getTime());
model.setTelEndTime(endTime.getTime());
AlertCalledFormDto alertDto = iAlertCalledService.selectAlertCalledByIdNoCache(model.getAlertId());
if(alertDto == null || alertDto.getAlertCalledDto() == null) {
throw new BadRequest("未找到相关警情");
}
model.setAlertStage(alertDto.getAlertCalledDto().getAlertStage());
model.setAlertStageCode(alertDto.getAlertCalledDto().getAlertStageCode());
model = voiceRecordFileServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment