|
|
@@ -25,14 +25,18 @@ import org.springblade.core.secure.BladeUser;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.jackson.JsonUtil;
|
|
|
+import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
|
|
|
import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
|
|
|
import org.springblade.modules.yjxt.business.warn.dto.OriginalWarningInfoDTO;
|
|
|
import org.springblade.modules.yjxt.business.warn.entity.OriginalWarningInfoEntity;
|
|
|
+import org.springblade.modules.yjxt.business.warn.entity.WarnResponseInfoEntity;
|
|
|
import org.springblade.modules.yjxt.business.warn.service.IOriginalWarningService;
|
|
|
import org.springblade.modules.yjxt.business.warn.vo.OriginalWarningInfoVO;
|
|
|
+import org.springblade.modules.yjxt.business.warn.entity.WarnDetailInfoEntity;
|
|
|
import org.springblade.modules.yjxt.business.warn.vo.WarnDetailInfoVO;
|
|
|
+import org.springblade.modules.yjxt.business.warn.vo.WarnResponseInfoVO;
|
|
|
import org.springblade.modules.yjxt.business.warn.wrapper.OriginalWarningWrapper;
|
|
|
import org.springblade.modules.yjxt.business.warn.wrapper.YjWarnInfoWrapper;
|
|
|
import org.springblade.utils.HttpRequestUtil;
|
|
|
@@ -44,6 +48,8 @@ import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/***
|
|
|
* Date:2023/11/12
|
|
|
@@ -101,12 +107,12 @@ public class YjWarnController extends BladeController {
|
|
|
return R.fail("查询失败");
|
|
|
}
|
|
|
entity.setWarnAdcd(deptRegionEntity.getAdcd());
|
|
|
- }else if(BusinessConstant.ROLE_QI_ADMIN.equals(user.getRoleName())){
|
|
|
+ } else if (BusinessConstant.ROLE_QI_ADMIN.equals(user.getRoleName())) {
|
|
|
LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
|
|
|
wrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
|
|
|
wrapper.last("limit 1");
|
|
|
DeptRegionEntity deptRegionEntity = deptRegionService.getOne(wrapper);
|
|
|
- if (Func.isNull(deptRegionEntity)){
|
|
|
+ if (Func.isNull(deptRegionEntity)) {
|
|
|
return R.fail("查询失败");
|
|
|
}
|
|
|
entity.setWarnAdcd(deptRegionEntity.getAdcd());
|
|
|
@@ -169,8 +175,44 @@ public class YjWarnController extends BladeController {
|
|
|
JSONObject res = HttpRequestUtil.doHttpGetRequest("查询预警详情", url, null, null, 20 * 1000);
|
|
|
if (res.getIntValue("code") == 200 && res.getBooleanValue("success")) {
|
|
|
JSONObject data = res.getJSONObject("data");
|
|
|
- WarnDetailInfoVO vo = JsonUtil.parse(data.toJSONString(), WarnDetailInfoVO.class);
|
|
|
- return R.data(vo);
|
|
|
+ if (Func.notNull(data)) {
|
|
|
+ WarnDetailInfoEntity warnDetailInfoEntity = JsonUtil.parse(data.toJSONString(), WarnDetailInfoEntity.class);
|
|
|
+ WarnDetailInfoVO vo = Objects.requireNonNull(BeanUtil.copy(warnDetailInfoEntity, WarnDetailInfoVO.class));
|
|
|
+ if (Func.notNull(vo.getWarnResponseInfoList())) {
|
|
|
+ List<WarnResponseInfoEntity> warnResponseInfoList = vo.getWarnResponseInfoList();
|
|
|
+ List<WarnResponseInfoVO> voList = new ArrayList<>(warnResponseInfoList.size());
|
|
|
+ for (WarnResponseInfoEntity warnResponseInfoEntity : warnResponseInfoList) {
|
|
|
+ WarnResponseInfoVO warnResponseInfoVO = Objects.requireNonNull(BeanUtil.copy(warnResponseInfoEntity, WarnResponseInfoVO.class));
|
|
|
+ if (Func.notNull(warnResponseInfoVO.getVariableOut())) {
|
|
|
+ JSONObject json = JSONObject.parseObject(warnResponseInfoVO.getVariableOut());
|
|
|
+ if (json.containsKey("DXJS")) {
|
|
|
+ warnResponseInfoVO.setDxjs(json.getString("DXJS"));
|
|
|
+ }
|
|
|
+ if (json.containsKey("RYSW")) {
|
|
|
+ warnResponseInfoVO.setRysw(json.getString("RYSW"));
|
|
|
+ }
|
|
|
+ if (json.containsKey("GDSH")) {
|
|
|
+ warnResponseInfoVO.setGdsh(json.getString("GDSH"));
|
|
|
+ }
|
|
|
+ if (json.containsKey("JYCX")) {
|
|
|
+ warnResponseInfoVO.setJycx(json.getString("JYCX"));
|
|
|
+ }
|
|
|
+ if (json.containsKey("SFCG")) {
|
|
|
+ warnResponseInfoVO.setSfcg(json.getString("SFCG"));
|
|
|
+ }
|
|
|
+ if (json.containsKey("RYZY")) {
|
|
|
+ warnResponseInfoVO.setRyzy(json.getString("RYZY"));
|
|
|
+ }
|
|
|
+ if (json.containsKey("SFQR")) {
|
|
|
+ warnResponseInfoVO.setSfqr(json.getString("SFQR"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ voList.add(warnResponseInfoVO);
|
|
|
+ }
|
|
|
+ vo.setWarnResponseList(voList);
|
|
|
+ }
|
|
|
+ return R.data(vo);
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage());
|