Commit 2e7a6dca authored by suhuiguang's avatar suhuiguang

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents e603a057 ee23cfb0
...@@ -79,6 +79,19 @@ public class MaintenanceCompany extends BaseEntity { ...@@ -79,6 +79,19 @@ public class MaintenanceCompany extends BaseEntity {
@TableField("longitude") @TableField("longitude")
private String longitude; private String longitude;
/**
* amos平台id
*/
@TableField("amos_org_id")
private String amosId;
/**
* amos账户名称
*/
@TableField("amos_org_name")
private String amosName;
/** /**
* 动态表单实例id * 动态表单实例id
*/ */
......
...@@ -4,12 +4,9 @@ import java.util.LinkedHashMap; ...@@ -4,12 +4,9 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -188,6 +185,7 @@ public interface EquipFeignClient { ...@@ -188,6 +185,7 @@ public interface EquipFeignClient {
*/ */
@RequestMapping(value = "/building/video/page", method = RequestMethod.GET) @RequestMapping(value = "/building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideo( @RequestParam("current") long current, @RequestParam("size") long size, @RequestParam("buildingId") Long buildingId); ResponseModel<Page<Map<String, Object>>> getVideo( @RequestParam("current") long current, @RequestParam("size") long size, @RequestParam("buildingId") Long buildingId);
@RequestMapping(value = "/building/video/page", method = RequestMethod.GET) @RequestMapping(value = "/building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideopag( @RequestParam("current") String current, ResponseModel<Page<Map<String, Object>>> getVideopag( @RequestParam("current") String current,
@RequestParam("size") String size, @RequestParam("size") String size,
...@@ -196,6 +194,24 @@ public interface EquipFeignClient { ...@@ -196,6 +194,24 @@ public interface EquipFeignClient {
@RequestParam("equipmentName") String equipmentName @RequestParam("equipmentName") String equipmentName
); );
@RequestMapping(value = "/monitorView/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> queryUncheckedVideoList(
@RequestParam(value = "viewId") Long viewId,
@RequestParam(value = "videoName" ,required =false) String videoName,
@RequestParam(value = "videoCode" ,required =false) String videoCode,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size
);
@RequestMapping(value = "/confirmAlarm/getDetailsById", method = RequestMethod.GET)
public Map<String, Object> getDetailsById(@RequestParam Long alamId, @RequestParam Long equipId, @RequestParam String type, @RequestParam String area) ;
/** /**
* *
*获取视频列表 *获取视频列表
......
...@@ -83,7 +83,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -83,7 +83,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
*/ */
List< OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId); List< OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId);
List<OrgUsr> amosIdExist(String amosId); int amosIdExist(String amosId);
void updatelistByParentId(String codex, String code); void updatelistByParentId(String codex, String code);
......
...@@ -627,12 +627,15 @@ GROUP BY ...@@ -627,12 +627,15 @@ GROUP BY
</select> </select>
<select id="amosIdExist" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr"> <select id="amosIdExist" resultType="int">
SELECT * select sum(num) from (
FROM cb_org_usr
WHERE is_delete = 0 SELECT count(*) AS num FROM cb_firefighters WHERE amos_user_id = #{amosId} and is_delete = 0
and
amos_org_id = #{amosId} union all SELECT count(*) AS num FROM cb_org_usr WHERE amos_org_id = #{amosId} and is_delete = 0
union all SELECT count(*) AS num FROM cb_maintenance_company WHERE amos_org_id = #{amosId} and is_delete = 0
) AS total;
</select> </select>
......
...@@ -336,6 +336,58 @@ public class CommandController extends BaseController { ...@@ -336,6 +336,58 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(pag); return ResponseHelper.buildResponse(pag);
} }
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询视图下的视频列表")
@RequestMapping(value = "monitorView/video/page", method = RequestMethod.GET)
public ResponseModel<Page<Map<String, Object>>> queryUncheckedVideoList(
@RequestParam(value = "viewId") Long viewId,
@RequestParam(value = "videoName" ,required =false) String videoName,
@RequestParam(value = "videoCode" ,required =false) String videoCode,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) throws Exception
{
ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.queryUncheckedVideoList(viewId,videoName, videoCode,current,size);
Page<Map<String, Object>> pag = data != null ? data.getResult() : null;
List<Map<String, Object>> records = pag != null ? pag.getRecords() : null;
if (records != null && records.size() > 0) {
for (Map<String, Object> record : records) {
ResponseModel<String> da = videoFeignClient.videoUrlByIndexCode(record.get("code") + "");
String url = da != null ? da.getResult().substring(da.getResult().indexOf("openUrl")) : null;
record.put("url", url);
}
pag.setRecords(records);
}
return ResponseHelper.buildResponse(pag);
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "confirmAlarm/getDetailsById")
@ApiOperation(value = "根据id,type查询确警页面相关数据")
public ResponseModel<Map<String, Object>> getDetailsById(@RequestParam Long alamId, @RequestParam Long equipId, @RequestParam String type, @RequestParam String area) {
Map<String, Object> data = equipFeignClient.getDetailsById( alamId, equipId, type, area);
List<Map<String, Object>> records = data != null ? (List<Map<String, Object>>)data.get("video") : null;
if (records != null && records.size() > 0) {
for (Map<String, Object> record : records) {
ResponseModel<String> da = videoFeignClient.videoUrlByIndexCode(record.get("code") + "");
String url = da != null ? da.getResult().substring(da.getResult().indexOf("openUrl")) : null;
record.put("url", url);
}
data.put("video",records);
}
return ResponseHelper.buildResponse(data);
}
/** /**
* 水源列表分页查询 * 水源列表分页查询
* *
...@@ -533,10 +585,15 @@ public class CommandController extends BaseController { ...@@ -533,10 +585,15 @@ public class CommandController extends BaseController {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(iWaterResourceService.selectBySequenceNbr(id))); JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(iWaterResourceService.selectBySequenceNbr(id)));
if(!ValidationUtil.isEmpty(jsonObject.get("buildDate"))) { if(!ValidationUtil.isEmpty(jsonObject.get("buildDate"))) {
LocalDateTime dateTime = (LocalDateTime) jsonObject.get("buildDate"); String str = jsonObject.get("buildDate").toString();
Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8"))); Date date = new Date(Long.parseLong(str));
jsonObject.remove("buildDate");
jsonObject.put("buildDate", DateUtils.convertDateToString(date,DateUtils.DATE_TIME_PATTERN)); jsonObject.put("buildDate", DateUtils.convertDateToString(date,DateUtils.DATE_TIME_PATTERN));
} else {
jsonObject.put("buildDate", "");
}
if(ValidationUtil.isEmpty(jsonObject.get("intakeHeight"))) {
jsonObject.put("intakeHeight", "");
} }
return ResponseHelper.buildResponse(jsonObject); return ResponseHelper.buildResponse(jsonObject);
......
...@@ -134,6 +134,15 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -134,6 +134,15 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
model.setBizCompany(orgUsr.getBizOrgName()); model.setBizCompany(orgUsr.getBizOrgName());
model.setBizCompanyCode(orgUsr.getBizOrgCode()); model.setBizCompanyCode(orgUsr.getBizOrgCode());
} }
// 地址处理
if (model.getAddress() != null) {
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(address.getString(BizConstant.ADDRESS));
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
FireStation entity = this.prepareEntity(model); FireStation entity = this.prepareEntity(model);
this.updateById(entity); this.updateById(entity);
return Bean.toModel(entity, model); return Bean.toModel(entity, model);
......
...@@ -1700,8 +1700,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1700,8 +1700,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
public Object amosIdExist(String amosId) { public Object amosIdExist(String amosId) {
List<OrgUsr> orgUsrs = orgUsrMapper.amosIdExist(amosId); int num = orgUsrMapper.amosIdExist(amosId);
if (orgUsrs.size() > 0) { if (num > 0) {
return false; return false;
} }
return true; return true;
......
...@@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -204,6 +205,28 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -204,6 +205,28 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
WaterResourceDto waterResourceDto = this.queryBySeq(sequenceNbr); WaterResourceDto waterResourceDto = this.queryBySeq(sequenceNbr);
waterResourceDto.setRealityImgList(JSONArray.parseArray(waterResourceDto.getRealityImg(), Object.class)); waterResourceDto.setRealityImgList(JSONArray.parseArray(waterResourceDto.getRealityImg(), Object.class));
waterResourceDto.setOrientationImgList(JSONArray.parseArray(waterResourceDto.getOrientationImg())); waterResourceDto.setOrientationImgList(JSONArray.parseArray(waterResourceDto.getOrientationImg()));
if(ValidationUtil.isEmpty(waterResourceDto.getContactUser())) {
waterResourceDto.setContactUser("");
}
if(ValidationUtil.isEmpty(waterResourceDto.getContactPhone())) {
waterResourceDto.setContactPhone("");
}
if(ValidationUtil.isEmpty(waterResourceDto.getManagementUnit())) {
waterResourceDto.setManagementUnit("");
}
if(ValidationUtil.isEmpty(waterResourceDto.getSection())) {
waterResourceDto.setSection("");
}
if(ValidationUtil.isEmpty(waterResourceDto.getWaterSupplyName())) {
waterResourceDto.setWaterSupplyName("");
}
Boolean isDelete = waterResourceDto.getIsDelete(); Boolean isDelete = waterResourceDto.getIsDelete();
// 查询属性信息 // 查询属性信息
String resourceType = waterResourceDto.getResourceType(); String resourceType = waterResourceDto.getResourceType();
...@@ -214,26 +237,35 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -214,26 +237,35 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
waterResourceHydrantService.getOne(new QueryWrapper<WaterResourceHydrant>().eq( waterResourceHydrantService.getOne(new QueryWrapper<WaterResourceHydrant>().eq(
"resource_id", "resource_id",
sequenceNbr)); sequenceNbr));
BeanUtils.copyProperties(waterResourceHydrant, waterResourceDto); if(null != waterResourceHydrant) {
BeanUtils.copyProperties(waterResourceHydrant, waterResourceDto);
}
break; break;
case "crane": case "crane":
WaterResourceCrane waterResourceCrane = WaterResourceCrane waterResourceCrane =
waterResourceCraneService.getOne(new QueryWrapper<WaterResourceCrane>().eq("resource_id", waterResourceCraneService.getOne(new QueryWrapper<WaterResourceCrane>().eq("resource_id",
sequenceNbr)); sequenceNbr));
BeanUtils.copyProperties(waterResourceCrane, waterResourceDto); if(null != waterResourceCrane) {
BeanUtils.copyProperties(waterResourceCrane, waterResourceDto);
}
break; break;
case "natural": case "natural":
WaterResourceNatural waterResourceNatural = WaterResourceNatural waterResourceNatural =
waterResourceNaturalService.getOne(new QueryWrapper<WaterResourceNatural>().eq( waterResourceNaturalService.getOne(new QueryWrapper<WaterResourceNatural>().eq(
"resource_id", "resource_id",
sequenceNbr)); sequenceNbr));
BeanUtils.copyProperties(waterResourceNatural, waterResourceDto); if(null != waterResourceNatural) {
BeanUtils.copyProperties(waterResourceNatural, waterResourceDto);
}
break; break;
case "pool": case "pool":
WaterResourcePool waterResourcePool = WaterResourcePool waterResourcePool =
waterResourcePoolService.getOne(new QueryWrapper<WaterResourcePool>().eq("resource_id", waterResourcePoolService.getOne(new QueryWrapper<WaterResourcePool>().eq("resource_id",
sequenceNbr)); sequenceNbr));
BeanUtils.copyProperties(waterResourcePool, waterResourceDto); if(null != waterResourcePool) {
BeanUtils.copyProperties(waterResourcePool, waterResourceDto);
}
break; break;
} }
} }
......
...@@ -116,6 +116,8 @@ public class RemoteSecurityService { ...@@ -116,6 +116,8 @@ public class RemoteSecurityService {
toke = getLogin(dPasswordAuthModel); toke = getLogin(dPasswordAuthModel);
} }
} }
RequestContext.setAppKey(toke.getAppKey());
RequestContext.setToken(toke.getToke());
} catch (InnerInvokException e) { } catch (InnerInvokException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -2310,5 +2310,17 @@ ...@@ -2310,5 +2310,17 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenzhao" id="2021-12-04-cz-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_maintenance_company"/>
</preConditions>
<comment>新增两个字段用来保存amos账户信息 </comment>
<sql>
ALTER TABLE `cb_maintenance_company` add amos_org_id varchar(100) COMMENT 'amos平台id';
ALTER TABLE `cb_maintenance_company` add amos_org_name varchar(30) COMMENT 'amos账户名称';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
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