Commit 636a8167 authored by tangwei's avatar tangwei

Merge branch 'developer' into develop_ccs

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/CarServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerTransferServiceImpl.java 解决冲突
parents f68386a1 e3db632c
......@@ -521,6 +521,7 @@ AND instance_id = (
car_id = #{carId}
and is_delete = 0
)
and is_delete = 0
) and field_code='telephone'
) ss
LEFT JOIN cb_org_usr cou ON ss.instance_id = cou.sequence_nbr
......
......@@ -1164,7 +1164,11 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
carInfoVo.setEquipmentName(equipment != null ? equipment.getName() : "");
carInfoVo.setCategoryId(equipment != null ? equipment.getCategoryId() : null);
carInfoVo.setCategoryName(categoryMap.get(carInfoVo.getCategoryId()));
if (car.getImg() != null) {
carInfoVo.setName(car.getName()+"("+car.getCarNum()+")");
if (car.getImg() != null){
List<String> img = new ArrayList<>();
img.add(car.getImg().get(0).getUrl());
carInfoVo.setImage(img);
......
......@@ -437,7 +437,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
// 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他
if(alertTypeCode.equals(AlertStageEnums.HKJY.getCode()) || alertTypeCode.equals(AlertStageEnums.LYXC.getCode())
if(alertTypeCode.equals(AlertStageEnums.TFSJ.getCode()) || alertTypeCode.equals(AlertStageEnums.LYXC.getCode())
|| alertTypeCode.equals(AlertStageEnums.ZJBZ.getCode()) || alertTypeCode.equals(AlertStageEnums.QTJQ.getCode())) {
if(e.containsKey("onDuty")) {
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew(e.get("name").toString());
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.*;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -7,14 +30,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
......@@ -27,24 +46,7 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
import java.util.stream.Collectors;
/**
* 力量调派 服务实现类
......@@ -839,13 +841,13 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
double agentCountAll = totalCarList.stream().mapToDouble(
car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
.filter(res -> equipType.equals(res.get("equipType")))
.mapToDouble(c -> (double) c.get("equipCount")).sum() : 0)
.mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount") ) ? "0" : c.get("equipCount").toString())).sum() : 0)
.sum();
double agentCountArrived = arrivedCarList.stream().mapToDouble(
car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
.filter(res -> equipType.equals(res.get("equipType")))
.mapToDouble(c -> (double) c.get("equipCount")).sum() : 0)
.mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount") ) ? "0" : c.get("equipCount").toString())).sum() : 0)
.sum();
JSONObject jsonObject = new JSONObject();
......
package com.yeejoin.amos.latentdanger.business.feign;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.cloud.openfeign.FeignClient;
......@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
/**
* 机场服务feign
*
......@@ -28,8 +31,15 @@ public interface JcsFeignClient {
/**
* 查询用户单位信息
*
* @return ResponseModel<ReginParams.PersonIdentity>
*/
@GetMapping(value = "/org-usr/getLoginUserDetails")
FeignClientResult getJcsUser();
/**
* 根据id获取单位人员列表
*/
@GetMapping(value = "/company/{ids}/person")
FeignClientResult<List<CompanyPerson>> selectCompanyPerson(@PathVariable List<Long> ids);
}
package com.yeejoin.amos.latentdanger.business.service.impl;
import com.google.common.collect.Sets;
import com.yeejoin.amos.boot.biz.common.constants.RuleConstant;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.latentdanger.business.dto.LatentDangerRo;
import com.yeejoin.amos.latentdanger.business.feign.JcsFeignClient;
import com.yeejoin.amos.latentdanger.business.util.DateUtil;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
......@@ -14,11 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Author: xl
......@@ -33,6 +39,8 @@ public class RuleDangerService {
@Autowired
private RuleTrigger ruleTrigger;
@Autowired
private JcsFeignClient jcsFeignClient;
public Boolean addLatentDangerRule(LatentDanger latentDanger, String ruleType, String roleName) throws Exception {
LatentDangerRo latentDangerRo = buildLatentDangerRo(latentDanger, ruleType);
......@@ -40,7 +48,27 @@ public class RuleDangerService {
List<RoleModel> result = Privilege.roleClient.queryRoleList(roleName, null).getResult();
if (result.size() > 0) {
List<AgencyUserModel> userModels = Privilege.agencyUserClient.queryByRoleId(String.valueOf(result.get(0).getSequenceNbr()), null).getResult();
List<String> userIds = userModels.stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
//只发送给本部门的人员
Long pointId = latentDanger.getBizInfo().getLong("pointId");
if (pointId == null || pointId == 0) {
return false;
}
FeignClientResult<List<CompanyPerson>> companyPersons = jcsFeignClient.selectCompanyPerson(Collections.singletonList(pointId));
if (companyPersons.getStatus() != 200) {
return false;
}
//本部门的人员列表
List<CompanyPerson> personList = companyPersons.getResult();
List<OrgUsrDto> OrgUsrDtos = new ArrayList<>();
personList.forEach(companyPerson -> OrgUsrDtos.addAll(companyPerson.getPersons()));
//角色人员列表与本部门的人员列表取交集
List<AgencyUserModel> userModelList = userModels.stream().filter(
agencyUserModel -> OrgUsrDtos.stream().anyMatch(
orgUsrDto -> agencyUserModel.getUserId().equals(orgUsrDto.getAmosOrgId())
)
).collect(Collectors.toList());
List<String> userIds = userModelList.stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
latentDangerRo.setRecivers(userIds);
}
//触发规则
......@@ -64,7 +92,7 @@ public class RuleDangerService {
return true;
}
private LatentDangerRo buildLatentDangerRo (LatentDanger latentDanger, String ruleType){
private LatentDangerRo buildLatentDangerRo(LatentDanger latentDanger, String ruleType) {
LatentDangerRo latentDangerRo = new LatentDangerRo();
BeanUtils.copyProperties(latentDanger, latentDangerRo);
latentDangerRo.setMsgType(msgType);
......@@ -86,7 +114,7 @@ public class RuleDangerService {
}
}
if (!ValidationUtil.isEmpty(type)){
if (!ValidationUtil.isEmpty(type)) {
Map<String, String> map = new HashMap<>();
map.put("type", type);
map.put("id", String.valueOf(latentDanger.getId()));
......
......@@ -592,8 +592,10 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据检查记录查询照片", notes = "根据检查记录查询照片")
@RequestMapping(value = "/getPictureByCheckId", method = RequestMethod.GET)
public CommonResponse getPictureByCheckId(@ApiParam(value = "检查记录ID") @RequestParam String checkId) {
List<String> pictures = checkService.getPictureByCheckId(checkId);
public CommonResponse getPictureByCheckId(@ApiParam(value = "检查记录ID") @RequestParam String checkId,
@ApiParam(value = "检查项ID") @RequestParam String id
) {
List<String> pictures = checkService.getPictureByCheckId(checkId,id);
return CommonResponseUtil.success(pictures);
}
}
......@@ -305,5 +305,5 @@ public interface CheckMapper extends BaseMapper {
*/
List<Check> getCheckListByTaskId(@Param(value = "planTaskId") long id);
List<String> getPictureByCheckId(String checkId);
List<String> getPictureByCheckId(String checkId,String id);
}
......@@ -1577,7 +1577,7 @@ public class CheckServiceImpl implements ICheckService {
Plan plan = planService.queryPlanById(planTask.getPlanId());
// 计划完成,规则推送消息
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()) {
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成, null);
}
......@@ -1686,7 +1686,7 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public List<String> getPictureByCheckId(String checkId) {
return checkMapper.getPictureByCheckId(checkId);
public List<String> getPictureByCheckId(String checkId, String id) {
return checkMapper.getPictureByCheckId(checkId,id);
}
}
......@@ -283,5 +283,5 @@ public interface ICheckService {
Page<CheckVo> queryPage(CheckPageParam criterias);
List<String> getPictureByCheckId(String checkId);
List<String> getPictureByCheckId(String checkId,String id);
}
......@@ -2057,8 +2057,14 @@
SELECT
photo_data
FROM
p_check_shot
p_check_shot a
LEFT JOIN
p_check_input b
ON
a.check_input_id=b.id
WHERE
check_id = #{checkId}
a.check_id = #{checkId}
AND
b.input_id= #{id}
</select>
</mapper>
\ No newline at end of file
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