|
|
|
@@ -3,6 +3,7 @@ package com.xueyi.system.digitalmans.controller; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.xueyi.common.core.utils.core.IdUtil; |
|
|
|
import com.xueyi.common.core.web.result.AjaxResult; |
|
|
|
import com.xueyi.common.core.web.result.R; |
|
|
|
import com.xueyi.common.core.web.validate.V_A; |
|
|
|
import com.xueyi.common.core.web.validate.V_E; |
|
|
|
import com.xueyi.common.log.annotation.Log; |
|
|
|
@@ -10,24 +11,21 @@ import com.xueyi.common.log.enums.BusinessType; |
|
|
|
import com.xueyi.common.security.annotation.Logical; |
|
|
|
import com.xueyi.common.security.annotation.RequiresPermissions; |
|
|
|
import com.xueyi.common.web.entity.controller.BaseController; |
|
|
|
import com.xueyi.system.api.digitalmans.domain.vo.DmBroadcastVo; |
|
|
|
import com.xueyi.system.digitalmans.domain.dto.DmBroadcastDto; |
|
|
|
import com.xueyi.system.digitalmans.domain.dto.DmDigitalmanDto; |
|
|
|
import com.xueyi.system.digitalmans.domain.merge.DmBroadcastResourceMerge; |
|
|
|
import com.xueyi.system.digitalmans.domain.query.DmBroadcastQuery; |
|
|
|
import com.xueyi.system.digitalmans.domain.query.DmDigitalmanQuery; |
|
|
|
import com.xueyi.system.digitalmans.manager.impl.DmBroadcastManager; |
|
|
|
import com.xueyi.system.digitalmans.service.IDmBroadcastService; |
|
|
|
import com.xueyi.system.digitalmans.service.IDmDigitalmanService; |
|
|
|
import com.xueyi.system.resource.domain.dto.DmResourcesDto; |
|
|
|
import com.xueyi.system.resource.domain.model.DmResourcesConverter; |
|
|
|
import com.xueyi.system.resource.mapper.DmResourcesMapper; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
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.RestController; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.io.Serializable; |
|
|
|
import java.util.ArrayList; |
|
|
|
@@ -56,6 +54,47 @@ public class DmBroadcastController extends BaseController<DmBroadcastQuery, DmBr |
|
|
|
@Autowired |
|
|
|
private DmResourcesConverter resourcesConverter; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IDmDigitalmanService digitalmanService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询播报列表 |
|
|
|
*/ |
|
|
|
@GetMapping("/inner/list") |
|
|
|
public R<DmBroadcastVo> innerlist(@RequestParam("manCode")String manCode) { |
|
|
|
DmDigitalmanQuery query = new DmDigitalmanQuery(); |
|
|
|
query.setManCode(manCode); |
|
|
|
List<DmDigitalmanDto> manList = digitalmanService.selectList(query); |
|
|
|
DmBroadcastQuery broadcast = new DmBroadcastQuery(); |
|
|
|
broadcast.setManId(manList.get(0).getId()); |
|
|
|
List<DmBroadcastDto> list = baseService.selectListScope(broadcast); |
|
|
|
|
|
|
|
if (list.size() > 0) { |
|
|
|
// 定义DmBroadcastVo类型变量vo,将list.get(0)赋值给vo |
|
|
|
DmBroadcastDto dto = list.get(0); |
|
|
|
DmBroadcastVo vo = new DmBroadcastVo(); |
|
|
|
vo.setSpeed(dto.getSpeed()); |
|
|
|
vo.setRecycle(dto.getRecycle()); |
|
|
|
List<JSONObject> rList = new ArrayList<>(); |
|
|
|
List<DmBroadcastResourceMerge> mergeDtos = broadcastManager.selectBroadcastResourceMerge(dto.getId()); |
|
|
|
int order = 0; |
|
|
|
for (DmBroadcastResourceMerge merge : mergeDtos) { |
|
|
|
if (merge.getResourceId() != null && merge.getResourceId() > 0) { |
|
|
|
|
|
|
|
DmResourcesDto resourcesDto = resourcesConverter.mapperDto(resourceMapper.selectById(merge.getResourceId())); |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("order",order++); |
|
|
|
json.put("ttsText",merge.getTtsText()); |
|
|
|
json.put("url", resourcesDto.getUrl()); |
|
|
|
rList.add(json); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setResource(rList); |
|
|
|
|
|
|
|
} |
|
|
|
return R.fail("无法获取播报信息"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询播报列表 |
|
|
|
*/ |
|
|
|
|