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 = ( ...@@ -521,6 +521,7 @@ AND instance_id = (
car_id = #{carId} car_id = #{carId}
and is_delete = 0 and is_delete = 0
) )
and is_delete = 0
) and field_code='telephone' ) and field_code='telephone'
) ss ) ss
LEFT JOIN cb_org_usr cou ON ss.instance_id = cou.sequence_nbr 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 ...@@ -1164,7 +1164,11 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
carInfoVo.setEquipmentName(equipment != null ? equipment.getName() : ""); carInfoVo.setEquipmentName(equipment != null ? equipment.getName() : "");
carInfoVo.setCategoryId(equipment != null ? equipment.getCategoryId() : null); carInfoVo.setCategoryId(equipment != null ? equipment.getCategoryId() : null);
carInfoVo.setCategoryName(categoryMap.get(carInfoVo.getCategoryId())); 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<>(); List<String> img = new ArrayList<>();
img.add(car.getImg().get(0).getUrl()); img.add(car.getImg().get(0).getUrl());
carInfoVo.setImage(img); carInfoVo.setImage(img);
......
...@@ -437,7 +437,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -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())) { || alertTypeCode.equals(AlertStageEnums.ZJBZ.getCode()) || alertTypeCode.equals(AlertStageEnums.QTJQ.getCode())) {
if(e.containsKey("onDuty")) { if(e.containsKey("onDuty")) {
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew(e.get("name").toString()); List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew(e.get("name").toString());
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; 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.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -7,14 +30,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -7,14 +30,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; 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.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto; 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.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; 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.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl; 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; ...@@ -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.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService; import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService;
import com.yeejoin.amos.component.rule.config.RuleConfig; 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 ...@@ -839,13 +841,13 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
double agentCountAll = totalCarList.stream().mapToDouble( double agentCountAll = totalCarList.stream().mapToDouble(
car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream() car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
.filter(res -> equipType.equals(res.get("equipType"))) .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(); .sum();
double agentCountArrived = arrivedCarList.stream().mapToDouble( double agentCountArrived = arrivedCarList.stream().mapToDouble(
car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream() car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
.filter(res -> equipType.equals(res.get("equipType"))) .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(); .sum();
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
......
package com.yeejoin.amos.latentdanger.business.feign; package com.yeejoin.amos.latentdanger.business.feign;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig; 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.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
...@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
/** /**
* 机场服务feign * 机场服务feign
* *
...@@ -28,8 +31,15 @@ public interface JcsFeignClient { ...@@ -28,8 +31,15 @@ public interface JcsFeignClient {
/** /**
* 查询用户单位信息 * 查询用户单位信息
*
* @return ResponseModel<ReginParams.PersonIdentity> * @return ResponseModel<ReginParams.PersonIdentity>
*/ */
@GetMapping(value = "/org-usr/getLoginUserDetails") @GetMapping(value = "/org-usr/getLoginUserDetails")
FeignClientResult getJcsUser(); FeignClientResult getJcsUser();
/**
* 根据id获取单位人员列表
*/
@GetMapping(value = "/company/{ids}/person")
FeignClientResult<List<CompanyPerson>> selectCompanyPerson(@PathVariable List<Long> ids);
} }
package com.yeejoin.amos.latentdanger.business.service.impl; 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.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.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; 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.feign.privilege.model.RoleModel;
import com.yeejoin.amos.latentdanger.business.dto.LatentDangerRo; 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.business.util.DateUtil;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState; import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger; import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
...@@ -14,11 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -14,11 +20,11 @@ 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.foundation.utils.ValidationUtil;
import java.util.Date; import java.util.*;
import java.util.HashMap; import java.util.function.Consumer;
import java.util.List; import java.util.function.Predicate;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* @Author: xl * @Author: xl
...@@ -33,6 +39,8 @@ public class RuleDangerService { ...@@ -33,6 +39,8 @@ public class RuleDangerService {
@Autowired @Autowired
private RuleTrigger ruleTrigger; private RuleTrigger ruleTrigger;
@Autowired
private JcsFeignClient jcsFeignClient;
public Boolean addLatentDangerRule(LatentDanger latentDanger, String ruleType, String roleName) throws Exception { public Boolean addLatentDangerRule(LatentDanger latentDanger, String ruleType, String roleName) throws Exception {
LatentDangerRo latentDangerRo = buildLatentDangerRo(latentDanger, ruleType); LatentDangerRo latentDangerRo = buildLatentDangerRo(latentDanger, ruleType);
...@@ -40,7 +48,27 @@ public class RuleDangerService { ...@@ -40,7 +48,27 @@ public class RuleDangerService {
List<RoleModel> result = Privilege.roleClient.queryRoleList(roleName, null).getResult(); List<RoleModel> result = Privilege.roleClient.queryRoleList(roleName, null).getResult();
if (result.size() > 0) { if (result.size() > 0) {
List<AgencyUserModel> userModels = Privilege.agencyUserClient.queryByRoleId(String.valueOf(result.get(0).getSequenceNbr()), null).getResult(); 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); latentDangerRo.setRecivers(userIds);
} }
//触发规则 //触发规则
...@@ -64,7 +92,7 @@ public class RuleDangerService { ...@@ -64,7 +92,7 @@ public class RuleDangerService {
return true; return true;
} }
private LatentDangerRo buildLatentDangerRo (LatentDanger latentDanger, String ruleType){ private LatentDangerRo buildLatentDangerRo(LatentDanger latentDanger, String ruleType) {
LatentDangerRo latentDangerRo = new LatentDangerRo(); LatentDangerRo latentDangerRo = new LatentDangerRo();
BeanUtils.copyProperties(latentDanger, latentDangerRo); BeanUtils.copyProperties(latentDanger, latentDangerRo);
latentDangerRo.setMsgType(msgType); latentDangerRo.setMsgType(msgType);
...@@ -86,7 +114,7 @@ public class RuleDangerService { ...@@ -86,7 +114,7 @@ public class RuleDangerService {
} }
} }
if (!ValidationUtil.isEmpty(type)){ if (!ValidationUtil.isEmpty(type)) {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("type", type); map.put("type", type);
map.put("id", String.valueOf(latentDanger.getId())); map.put("id", String.valueOf(latentDanger.getId()));
......
...@@ -592,8 +592,10 @@ public class CheckController extends AbstractBaseController { ...@@ -592,8 +592,10 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据检查记录查询照片", notes = "根据检查记录查询照片") @ApiOperation(value = "根据检查记录查询照片", notes = "根据检查记录查询照片")
@RequestMapping(value = "/getPictureByCheckId", method = RequestMethod.GET) @RequestMapping(value = "/getPictureByCheckId", method = RequestMethod.GET)
public CommonResponse getPictureByCheckId(@ApiParam(value = "检查记录ID") @RequestParam String checkId) { public CommonResponse getPictureByCheckId(@ApiParam(value = "检查记录ID") @RequestParam String checkId,
List<String> pictures = checkService.getPictureByCheckId(checkId); @ApiParam(value = "检查项ID") @RequestParam String id
) {
List<String> pictures = checkService.getPictureByCheckId(checkId,id);
return CommonResponseUtil.success(pictures); return CommonResponseUtil.success(pictures);
} }
} }
...@@ -305,5 +305,5 @@ public interface CheckMapper extends BaseMapper { ...@@ -305,5 +305,5 @@ public interface CheckMapper extends BaseMapper {
*/ */
List<Check> getCheckListByTaskId(@Param(value = "planTaskId") long id); 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 { ...@@ -1577,7 +1577,7 @@ public class CheckServiceImpl implements ICheckService {
Plan plan = planService.queryPlanById(planTask.getPlanId()); Plan plan = planService.queryPlanById(planTask.getPlanId());
// 计划完成,规则推送消息 // 计划完成,规则推送消息
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){ if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()) {
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成, null); rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成, null);
} }
...@@ -1686,7 +1686,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1686,7 +1686,7 @@ public class CheckServiceImpl implements ICheckService {
} }
@Override @Override
public List<String> getPictureByCheckId(String checkId) { public List<String> getPictureByCheckId(String checkId, String id) {
return checkMapper.getPictureByCheckId(checkId); return checkMapper.getPictureByCheckId(checkId,id);
} }
} }
...@@ -283,5 +283,5 @@ public interface ICheckService { ...@@ -283,5 +283,5 @@ public interface ICheckService {
Page<CheckVo> queryPage(CheckPageParam criterias); Page<CheckVo> queryPage(CheckPageParam criterias);
List<String> getPictureByCheckId(String checkId); List<String> getPictureByCheckId(String checkId,String id);
} }
...@@ -2057,8 +2057,14 @@ ...@@ -2057,8 +2057,14 @@
SELECT SELECT
photo_data photo_data
FROM FROM
p_check_shot p_check_shot a
LEFT JOIN
p_check_input b
ON
a.check_input_id=b.id
WHERE WHERE
check_id = #{checkId} a.check_id = #{checkId}
AND
b.input_id= #{id}
</select> </select>
</mapper> </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