Commit 6add715e authored by zhangsen's avatar zhangsen

daima tijaio

parent 8c172f01
...@@ -205,13 +205,14 @@ public class PlanVisual3dController extends BaseController { ...@@ -205,13 +205,14 @@ public class PlanVisual3dController extends BaseController {
@ApiOperation(value = "根据批次号获取预案的消息等记录", notes = "根据批次号获取预案的消息等记录") @ApiOperation(value = "根据批次号获取预案的消息等记录", notes = "根据批次号获取预案的消息等记录")
@GetMapping(value = "/plan/getPlaneRecordByNew") @GetMapping(value = "/plan/getPlaneRecordByNew")
public ResponseModel<ContingencyPlanInstanceVO> getPlaneRecordByNew(@RequestParam Integer pageNum, @RequestParam Integer size, @RequestParam(required = false) String batchNo) { public ResponseModel<ContingencyPlanInstanceVO> getPlaneRecordByNew(@RequestParam Integer pageNum, @RequestParam Integer size, @RequestParam(required = false) String batchNo) {
AgencyUserModel user = getUserInfo();
if (!StringUtil.isNotEmpty(batchNo)) { if (!StringUtil.isNotEmpty(batchNo)) {
batchNo = planVisual3dService.getNewestBatchNo(); batchNo = planVisual3dService.getNewestBatchNo();
} }
if (!StringUtil.isNotEmpty(batchNo)) { if (!StringUtil.isNotEmpty(batchNo)) {
return CommonResponseUtil.successNew(null); return CommonResponseUtil.successNew(null);
} }
return CommonResponseUtil.successNew(planVisual3dService.getPlaneRecordByNew(pageNum, size, batchNo)); return CommonResponseUtil.successNew(planVisual3dService.getPlaneRecordByNew(pageNum, size, batchNo, user));
} }
@Permission @Permission
......
...@@ -40,6 +40,7 @@ import org.springframework.util.ObjectUtils; ...@@ -40,6 +40,7 @@ import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -375,7 +376,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -375,7 +376,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
} }
@Override @Override
public Page<ContingencyPlanInstanceVO> getPlaneRecordByNew(Integer pageNum, Integer size, String batchNo) { public Page<ContingencyPlanInstanceVO> getPlaneRecordByNew(Integer pageNum, Integer size, String batchNo, AgencyUserModel user) {
Integer planInstanceCount = contingencyPlanInstanceMapper.getPlanInstanceCount(batchNo); Integer planInstanceCount = contingencyPlanInstanceMapper.getPlanInstanceCount(batchNo);
// 根据批次号获取预案记录 // 根据批次号获取预案记录
List<ContingencyPlanInstance> planInstanceListByPage = contingencyPlanInstanceMapper.getPlanInstanceListByPage(batchNo, (pageNum - 1) * size, size); List<ContingencyPlanInstance> planInstanceListByPage = contingencyPlanInstanceMapper.getPlanInstanceListByPage(batchNo, (pageNum - 1) * size, size);
...@@ -383,7 +384,8 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -383,7 +384,8 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
if (!CollectionUtils.isEmpty(planInstanceListByPage)) { if (!CollectionUtils.isEmpty(planInstanceListByPage)) {
planInstanceListByPage.stream().forEach(item -> { planInstanceListByPage.stream().forEach(item -> {
ContingencyPlanInstanceVO instanceVO = new ContingencyPlanInstanceVO(); ContingencyPlanInstanceVO instanceVO = new ContingencyPlanInstanceVO();
BeanUtils.copyProperties(planInstanceListByPage, instanceVO); BeanUtils.copyProperties(item, instanceVO);
instanceVO.setLoginUserId(user.getUserId());
list.add(instanceVO); list.add(instanceVO);
}); });
list.stream().sorted(Comparator.comparing(ContingencyPlanInstanceVO::getCreateDate)).collect(Collectors.toList()); list.stream().sorted(Comparator.comparing(ContingencyPlanInstanceVO::getCreateDate)).collect(Collectors.toList());
...@@ -432,6 +434,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -432,6 +434,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
dto.setCreateDate(new Date()); dto.setCreateDate(new Date());
Map<String, String> userInfo = contingencyPlanInstanceMapper.getUserByUserId(user.getUserId()); Map<String, String> userInfo = contingencyPlanInstanceMapper.getUserByUserId(user.getUserId());
dto.setPersonImg(userInfo.get("personImg")); dto.setPersonImg(userInfo.get("personImg"));
dto.setContent(StringUtil.isNotEmpty(dto.getContent()) ? dto.getContent() : "");
repository.save(dto); repository.save(dto);
try { try {
String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan");
......
...@@ -92,7 +92,7 @@ public interface IPlanVisual3dService { ...@@ -92,7 +92,7 @@ public interface IPlanVisual3dService {
* @param batchNo * @param batchNo
* @return * @return
*/ */
Page<ContingencyPlanInstanceVO> getPlaneRecordByNew(Integer pageNum, Integer size, String batchNo); Page<ContingencyPlanInstanceVO> getPlaneRecordByNew(Integer pageNum, Integer size, String batchNo, AgencyUserModel user);
ContingencyPlanInstance replyMessage(AgencyUserModel user, ContingencyPlanInstance dto); ContingencyPlanInstance replyMessage(AgencyUserModel user, ContingencyPlanInstance dto);
......
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