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 {
@TableField("longitude")
private String longitude;
/**
* amos平台id
*/
@TableField("amos_org_id")
private String amosId;
/**
* amos账户名称
*/
@TableField("amos_org_name")
private String amosName;
/**
* 动态表单实例id
*/
......
......@@ -4,12 +4,9 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
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.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -188,6 +185,7 @@ public interface EquipFeignClient {
*/
@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);
@RequestMapping(value = "/building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideopag( @RequestParam("current") String current,
@RequestParam("size") String size,
......@@ -196,6 +194,24 @@ public interface EquipFeignClient {
@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> {
*/
List< OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId);
List<OrgUsr> amosIdExist(String amosId);
int amosIdExist(String amosId);
void updatelistByParentId(String codex, String code);
......
......@@ -627,12 +627,15 @@ GROUP BY
</select>
<select id="amosIdExist" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
SELECT *
FROM cb_org_usr
WHERE is_delete = 0
and
amos_org_id = #{amosId}
<select id="amosIdExist" resultType="int">
select sum(num) from (
SELECT count(*) AS num FROM cb_firefighters WHERE amos_user_id = #{amosId} and is_delete = 0
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>
......
......@@ -336,6 +336,58 @@ public class CommandController extends BaseController {
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 {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(iWaterResourceService.selectBySequenceNbr(id)));
if(!ValidationUtil.isEmpty(jsonObject.get("buildDate"))) {
LocalDateTime dateTime = (LocalDateTime) jsonObject.get("buildDate");
Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8")));
jsonObject.remove("buildDate");
String str = jsonObject.get("buildDate").toString();
Date date = new Date(Long.parseLong(str));
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);
......
......@@ -134,6 +134,15 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
model.setBizCompany(orgUsr.getBizOrgName());
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);
this.updateById(entity);
return Bean.toModel(entity, model);
......
......@@ -1700,8 +1700,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
public Object amosIdExist(String amosId) {
List<OrgUsr> orgUsrs = orgUsrMapper.amosIdExist(amosId);
if (orgUsrs.size() > 0) {
int num = orgUsrMapper.amosIdExist(amosId);
if (num > 0) {
return false;
}
return true;
......
......@@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
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.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -204,6 +205,28 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
WaterResourceDto waterResourceDto = this.queryBySeq(sequenceNbr);
waterResourceDto.setRealityImgList(JSONArray.parseArray(waterResourceDto.getRealityImg(), Object.class));
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();
// 查询属性信息
String resourceType = waterResourceDto.getResourceType();
......@@ -214,26 +237,35 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
waterResourceHydrantService.getOne(new QueryWrapper<WaterResourceHydrant>().eq(
"resource_id",
sequenceNbr));
BeanUtils.copyProperties(waterResourceHydrant, waterResourceDto);
if(null != waterResourceHydrant) {
BeanUtils.copyProperties(waterResourceHydrant, waterResourceDto);
}
break;
case "crane":
WaterResourceCrane waterResourceCrane =
waterResourceCraneService.getOne(new QueryWrapper<WaterResourceCrane>().eq("resource_id",
sequenceNbr));
BeanUtils.copyProperties(waterResourceCrane, waterResourceDto);
if(null != waterResourceCrane) {
BeanUtils.copyProperties(waterResourceCrane, waterResourceDto);
}
break;
case "natural":
WaterResourceNatural waterResourceNatural =
waterResourceNaturalService.getOne(new QueryWrapper<WaterResourceNatural>().eq(
"resource_id",
sequenceNbr));
BeanUtils.copyProperties(waterResourceNatural, waterResourceDto);
if(null != waterResourceNatural) {
BeanUtils.copyProperties(waterResourceNatural, waterResourceDto);
}
break;
case "pool":
WaterResourcePool waterResourcePool =
waterResourcePoolService.getOne(new QueryWrapper<WaterResourcePool>().eq("resource_id",
sequenceNbr));
BeanUtils.copyProperties(waterResourcePool, waterResourceDto);
if(null != waterResourcePool) {
BeanUtils.copyProperties(waterResourcePool, waterResourceDto);
}
break;
}
}
......
......@@ -116,6 +116,8 @@ public class RemoteSecurityService {
toke = getLogin(dPasswordAuthModel);
}
}
RequestContext.setAppKey(toke.getAppKey());
RequestContext.setToken(toke.getToke());
} catch (InnerInvokException e) {
e.printStackTrace();
}
......
......@@ -2310,5 +2310,17 @@
</sql>
</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>
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