Commit 3149c8d4 authored by kongfm's avatar kongfm

Merge remote-tracking branch 'origin/developer' into developer

parents 6ada879d 0ebeaf8f
...@@ -34,6 +34,8 @@ public class RedisKey { ...@@ -34,6 +34,8 @@ public class RedisKey {
public static final String WECHAT_TOKEN = "wechat_token"; public static final String WECHAT_TOKEN = "wechat_token";
/**微信公众平台 token */ /**微信公众平台 token */
public static final String WECHAT_JS_TOKEN = "wechat_js_token"; public static final String WECHAT_JS_TOKEN = "wechat_js_token";
/**警情联系人*/
public static final String CONTACT_USER = "contact_user";
/** 驼峰转下划线(简单写法,效率低于 ) */ /** 驼峰转下划线(简单写法,效率低于 ) */
public static String humpToLine(String str) { public static String humpToLine(String str) {
......
...@@ -32,7 +32,7 @@ public class DynamicFormInitDto implements Serializable{ ...@@ -32,7 +32,7 @@ public class DynamicFormInitDto implements Serializable{
private Object defaultValue; private Object defaultValue;
@ApiModelProperty(value = "表单值") @ApiModelProperty(value = "表单值")
private SelectItems data = new SelectItems(); private Object data ;
@ApiModelProperty(value = "提交表单附加字段") @ApiModelProperty(value = "提交表单附加字段")
private DynamicFormInstanceDto formItemDescr; private DynamicFormInstanceDto formItemDescr;
......
package com.yeejoin.amos.boot.module.common.api.feign; package com.yeejoin.amos.boot.module.common.api.feign;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.PageDto;
import com.yeejoin.amos.boot.module.common.api.dto.VideoDto; import com.yeejoin.amos.boot.module.common.api.dto.VideoDto;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
...@@ -280,4 +279,28 @@ public interface EquipFeignClient { ...@@ -280,4 +279,28 @@ public interface EquipFeignClient {
@RequestMapping(value = "/equipment/listLike/{code}", method = RequestMethod.GET) @RequestMapping(value = "/equipment/listLike/{code}", method = RequestMethod.GET)
ResponseModel<List<LinkedHashMap<String, Object>>> listLikePage(@PathVariable String code); ResponseModel<List<LinkedHashMap<String, Object>>> listLikePage(@PathVariable String code);
/**
* 未处理消防告警 by litw 2021年10月25日
*
* @return
*/
@RequestMapping(value = "/confirmAlarm/getFireAlarm", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getFireAlarm();
/**
* 未处理消防告警 by litw 2021年10月25日
*
* @return
*/
@RequestMapping(value = "/confirmAlarm/getFaultAlarm", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getFaultAlarm();
/**
* 未处理消防告警 by litw 2021年10月25日
*
* @return
*/
@RequestMapping(value = "/confirmAlarm/getMonitorEvent", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getMonitorEvent();
} }
package com.yeejoin.amos.boot.module.common.api.feign;
import com.alibaba.fastjson.JSONObject;
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.typroject.tyboot.core.restful.utils.ResponseModel;
/**
* 隐患服务feign
*
* @author Dell
*/
@FeignClient(name = "${latentDanger.feign.name}", path = "latentDanger", configuration = {MultipartSupportConfig.class})
public interface LatentDangerFeignClient {
/**
* 获取未完成隐患数量
*
* @return
*/
@RequestMapping(value = "/api/latent/danger/app/unFinished", method = RequestMethod.GET)
ResponseModel<Object> getUnFinishedDangerCount();
}
...@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto; ...@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import java.util.List; import java.util.List;
...@@ -70,5 +71,6 @@ public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr); ...@@ -70,5 +71,6 @@ public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr);
public List<KeySiteDateDto> getKeySiteDate(Long id); public List<KeySiteDateDto> getKeySiteDate(Long id);
public List<KeySite> getKeySiteDateByNameLike(String name);
} }
...@@ -162,7 +162,7 @@ WHERE ...@@ -162,7 +162,7 @@ WHERE
<select id="getFirefightersName" resultType="Map"> <select id="getFirefightersName" resultType="Map">
SELECT SELECT
cb_firefighters.name AS name, cb_firefighters.name AS name,
cb_firefighters.mobile_phone AS phone IFNULL(cb_firefighters.mobile_phone, '') AS phone
FROM FROM
cb_firefighters cb_firefighters
WHERE WHERE
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* @author litw
* @date 2021-10-25.
*/
@Data
@ApiModel(value="AlertCalledDto", description="app领导统计")
public class AlarmGiveStatisticsDto {
/**
* 异常总数
* */
Integer allNum;
/**
* 119接警未结案警情数量
* */
Integer alarmNum;
/**
* 未处置的消防报警+未处置的故障告警+未处置的物联报警数量
* */
Integer iotDetection;
/**
* 消防巡查未关闭隐患数量+ 消防监督检查未关闭隐患数量
* */
Integer currentHiddenDanger;
}
...@@ -36,4 +36,7 @@ public class ShiftChangeDto extends BaseDto { ...@@ -36,4 +36,7 @@ public class ShiftChangeDto extends BaseDto {
@ApiModelProperty(value = "操作人名称") @ApiModelProperty(value = "操作人名称")
private String recUserName; private String recUserName;
@ApiModelProperty(value = "日常工作")
private String dutyWork;
} }
...@@ -43,4 +43,10 @@ public class ShiftChange extends BaseEntity { ...@@ -43,4 +43,10 @@ public class ShiftChange extends BaseEntity {
*/ */
@TableField("remark") @TableField("remark")
private String remark; private String remark;
/**
* 日常工作
*/
@TableField("duty_work")
private String dutyWork;
} }
package com.yeejoin.amos.boot.module.jcs.api.mapper; package com.yeejoin.amos.boot.module.jcs.api.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData; import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/** /**
* 警情接警记录 Mapper 接口 * 警情接警记录 Mapper 接口
...@@ -59,4 +59,12 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -59,4 +59,12 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
//未结束灾情列表 //未结束灾情列表
List<AlertCalled> AlertCalledStatusPage(@Param("current")Integer current, @Param("size")Integer size); List<AlertCalled> AlertCalledStatusPage(@Param("current")Integer current, @Param("size")Integer size);
List<Map<String, Object>> getOrgUserLocation(String locationt);
List<Map<String, Object>> getAlertCalledLocation(String locationt);
List<Map<String, Object>> getKeySiteLocation(String locationt);
List<Map<String, Object>> getAirportLocation(String locationt);
} }
...@@ -129,7 +129,9 @@ ...@@ -129,7 +129,9 @@
a.rescue_grid, a.rescue_grid,
a.coordinate_x, a.coordinate_x,
a.coordinate_y, a.coordinate_y,
a.response_level a.response_level,
a.system_source,
a.system_source_code
FROM FROM
jc_alert_called a jc_alert_called a
<where> <where>
...@@ -229,7 +231,7 @@ ...@@ -229,7 +231,7 @@
<select id="getContactName" resultType="Map"> <select id="getContactName" resultType="Map">
SELECT SELECT
jc_alert_called.contact_user AS name, jc_alert_called.contact_user AS name,
jc_alert_called.contact_phone AS phone IFNULL(jc_alert_called.contact_phone, '') AS phone
FROM FROM
jc_alert_called jc_alert_called
WHERE WHERE
...@@ -261,11 +263,51 @@ ...@@ -261,11 +263,51 @@
</select> </select>
<select id="getKeySiteLocation" resultType="Map">
SELECT
address_desc AS location,
latitude,
longitude
FROM
cb_key_site
WHERE
address_desc LIKE CONCAT('%',#{locationt},'%') and is_delete=0
</select>
<select id="getAlertCalledLocation" resultType="Map">
SELECT
address as location,
coordinate_x as latitude ,
coordinate_y as longitude
FROM
jc_alert_called
WHERE
address LIKE CONCAT('%',#{locationt},'%') and is_delete=0
</select>
<select id="getOrgUserLocation" resultType="Map">
SELECT
tt.location,
tt.longitude,
tt.latitude
from (
select
case when field_code='companyLocation' then field_value end as location,
case when field_code='longitude' then field_value end as longitude,
case when field_code='latitude' then field_value end as latitude
from cb_dynamic_form_instance
where group_code='244' ) tt where tt.location like CONCAT('%',#{locationt},'%') and tt.location is not null
</select>
<select id="getAirportLocation" resultType="Map">
SELECT
stand_code as location,
longitude,
latitude
FROM
jc_airport_stand
WHERE
stand_code LIKE CONCAT('%',#{locationt},'%') and is_delete=0
</select>
</mapper> </mapper>
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.command.biz.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.command.biz.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -17,6 +18,7 @@ import com.yeejoin.amos.boot.module.command.api.dto.CarTaskDto; ...@@ -17,6 +18,7 @@ import com.yeejoin.amos.boot.module.command.api.dto.CarTaskDto;
import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto; import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService; import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto;
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.feign.IotFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
...@@ -39,10 +41,14 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue; ...@@ -39,10 +41,14 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources;
import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar; import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResourcesMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.*; import com.yeejoin.amos.boot.module.jcs.api.service.*;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -50,7 +56,9 @@ import org.springframework.web.bind.annotation.*; ...@@ -50,7 +56,9 @@ import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException; import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.DateUtil; import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -65,6 +73,7 @@ import java.util.ArrayList; ...@@ -65,6 +73,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* *指挥资源Api * *指挥资源Api
...@@ -120,18 +129,24 @@ public class CommandController extends BaseController { ...@@ -120,18 +129,24 @@ public class CommandController extends BaseController {
private String readUrl; private String readUrl;
@Autowired @Autowired
EquipFeignClient equipFeignClient; EquipFeignClient equipFeignClient;
@Autowired
PowerTransferMapper powerTransferMapper;
@Autowired @Autowired
VideoFeignClient videoFeignClient; VideoFeignClient videoFeignClient;
@Autowired @Autowired
IKeySiteService keySiteService; IKeySiteService keySiteService;
@Autowired @Autowired
EquipFeignClient equipFeignService;
@Autowired
IPowerTransferCompanyService powerTransferCompanyService; IPowerTransferCompanyService powerTransferCompanyService;
@Autowired @Autowired
IPowerTransferCompanyResourcesService powerTransferCompanyResourcesService; IPowerTransferCompanyResourcesService powerTransferCompanyResourcesService;
@Autowired @Autowired
PowerTransferCompanyResourcesMapper powerTransferCompanyResourcesMapper;
@Autowired
ISourceFileService sourceFileService; ISourceFileService sourceFileService;
@Value("${video.url}") @Value("${video.url}")
...@@ -1031,9 +1046,28 @@ public class CommandController extends BaseController { ...@@ -1031,9 +1046,28 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "fireCar/list") @GetMapping(value = "fireCar/list")
@ApiOperation(httpMethod = "GET", value = "车辆资源", notes = "车辆资源") @ApiOperation(httpMethod = "GET", value = "车辆资源", notes = "车辆资源")
public ResponseModel<List<Map<String,Object>>> getTeamCarList(RequestData par) { public ResponseModel<Object> getTeamCarList(RequestData par) {
ResponseModel<List<Map<String, Object>>> date= equipFeignClient.getTeamCarList(par.getLongitude(),par.getLatitude()); /*bug 2583 地图屏,消防车辆类型时,左侧车辆状态显示错误 陈召 开始 */
ResponseModel<List<Map<String, Object>>> date= equipFeignClient.getTeamCarList(par.getLongitude(),par.getLatitude());
List<Map<String, Object>> result = date.getResult();
QueryWrapper<PowerTransferCompanyResources> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status", FireCarStatusEnum.执行中.getCode() );
List<PowerTransferCompanyResources> alertFormValue = powerTransferCompanyResourcesMapper.selectList(queryWrapper);
result.stream().forEach(e->{
if (e.get("carState").equals("在位")){
e.put("carState",FireCarStatusEnum.执勤.getName());
}
String sequenceNbr = e.get("sequenceNbr").toString();
//同步力量调派车辆任务状态
alertFormValue.stream().forEach(v->{
if (v.getResourcesId().equals(sequenceNbr)) {
String carStatus = v.getCarStatus();
e.put("carState",carStatus!=null?FireCarStatusEnum.getEnum(carStatus).getName():null);
}
});
});
return ResponseHelper.buildResponse(date!=null?date.getResult():null); return ResponseHelper.buildResponse(date!=null?date.getResult():null);
/*bug 2583 地图屏,消防车辆类型时,左侧车辆状态显示错误 2021-10-26 陈召 结束 */
} }
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
......
...@@ -25,7 +25,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -25,7 +25,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService; import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
......
...@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto; ...@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
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.service.IKeySiteService; import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService; import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
...@@ -226,7 +227,11 @@ public class KeySiteController extends BaseController { ...@@ -226,7 +227,11 @@ public class KeySiteController extends BaseController {
return ResponseHelper.buildResponse(keySiteService.getKeySiteDate(id)); return ResponseHelper.buildResponse(keySiteService.getKeySiteDate(id));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "通过名称模糊查询重点部位的信息", notes = "通过名称模糊查询重点部位的信息")
@GetMapping(value = "/getKeySiteDateByNameLike")
public ResponseModel<List<KeySite>> getKeySiteDateByNameLike(@RequestParam String name) {
return ResponseHelper.buildResponse(keySiteService.getKeySiteDateByNameLike(name));
}
} }
...@@ -11,12 +11,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController; ...@@ -11,12 +11,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils; import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil; import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResource; import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceCrane;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceHydrant;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceIot;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourceNatural;
import com.yeejoin.amos.boot.module.common.api.entity.WaterResourcePool;
import com.yeejoin.amos.boot.module.common.api.enums.WaterResourceTypeEnum; import com.yeejoin.amos.boot.module.common.api.enums.WaterResourceTypeEnum;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*; import com.yeejoin.amos.boot.module.common.biz.service.impl.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -83,13 +78,12 @@ public class WaterResourceController extends BaseController { ...@@ -83,13 +78,12 @@ public class WaterResourceController extends BaseController {
Optional<WaterResourceTypeEnum> resourceTypeEnum = EnumsUtils.getEnumObject(WaterResourceTypeEnum.class, Optional<WaterResourceTypeEnum> resourceTypeEnum = EnumsUtils.getEnumObject(WaterResourceTypeEnum.class,
e -> e.getCode().equals(resourceType)); e -> e.getCode().equals(resourceType));
/*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/ /*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/
List<Object> realityImgList = model.getRealityImgList(); // List<Object> realityImgList = model.getRealityImgList();
/* /*
if (realityImgList != null ){ if (realityImgList != null ){
} }
realityImgList.forEach(i->{ realityImgList.forEach(i->{
((Map<String, Object>) i).put("name",QRCodeUtil.generateQRCode()+"."+i.toString().substring(i.toString().lastIndexOf(".") + 1).toLowerCase()); ((Map<String, Object>) i).put("name",QRCodeUtil.generateQRCode()+"."+i.toString().substring(i.toString().lastIndexOf(".") + 1).toLowerCase());
});*/ });*/
...@@ -97,7 +91,7 @@ public class WaterResourceController extends BaseController { ...@@ -97,7 +91,7 @@ public class WaterResourceController extends BaseController {
model.setResourceTypeName(resourceTypeEnum.get().getName()); model.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(JSONArray.toJSONString(realityImgList)); model.setRealityImg(null);
model.setOrientationImg(JSONArray.toJSONString(model. getOrientationImgList())); model.setOrientationImg(JSONArray.toJSONString(model. getOrientationImgList()));
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/ /*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
/* if(model.getAddress()!=null){ /* if(model.getAddress()!=null){
...@@ -160,11 +154,9 @@ public class WaterResourceController extends BaseController { ...@@ -160,11 +154,9 @@ public class WaterResourceController extends BaseController {
} else { } else {
waterResourceServiceImpl.createWithModel(model); waterResourceServiceImpl.createWithModel(model);
} }
if (model.getAttachments() != null){
if (model.getAttachments() != null && ! model.getAttachments().isEmpty()){
sourceFileService.saveAttachments(model.getSequenceNbr(),model.getAttachments()); sourceFileService.saveAttachments(model.getSequenceNbr(),model.getAttachments());
} }
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
...@@ -189,6 +181,7 @@ public class WaterResourceController extends BaseController { ...@@ -189,6 +181,7 @@ public class WaterResourceController extends BaseController {
/*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/ /*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/
if (model.getAttachments() != null && ! model.getAttachments().isEmpty()){ if (model.getAttachments() != null && ! model.getAttachments().isEmpty()){
sourceFileService.saveAttachments(model.getSequenceNbr(),model.getAttachments()); sourceFileService.saveAttachments(model.getSequenceNbr(),model.getAttachments());
} }
/*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/ /*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/
// 更新基本信息 // 更新基本信息
......
...@@ -8,9 +8,6 @@ import java.util.List; ...@@ -8,9 +8,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -18,6 +15,7 @@ import org.springframework.stereotype.Service; ...@@ -18,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
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;
...@@ -26,6 +24,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -26,6 +24,14 @@ 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.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.CurrentStatusDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.dto.StatusDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum; import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService; import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
......
...@@ -317,4 +317,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -317,4 +317,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
public List<String> getAddress(){ public List<String> getAddress(){
return keySiteMapper.getAddress(); return keySiteMapper.getAddress();
} }
@Override
public List<KeySite> getKeySiteDateByNameLike(String name) {
LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>();
mapper.eq(KeySite::getIsDelete, false);
mapper.like(KeySite::getName, name);
return this.baseMapper.selectList(mapper);
}
} }
...@@ -706,7 +706,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -706,7 +706,7 @@ public class MaintenanceCompanyServiceImpl
maintenanceCompany.put("code", list.getCode()); maintenanceCompany.put("code", list.getCode());
maintenanceCompany.put("name", list.getName()); maintenanceCompany.put("name", list.getName());
maintenanceCompany.put("type", 1); maintenanceCompany.put("type", 1);
maintenanceCompany.put("parentId", null); maintenanceCompany.put("parentId", 0);
// 查询该维保单位下的业主信息 // 查询该维保单位下的业主信息
List<OrgUsrDto> orgUsrDtos = this.baseMapper.selectOrgUsrList(list.getSequenceNbr()); List<OrgUsrDto> orgUsrDtos = this.baseMapper.selectOrgUsrList(list.getSequenceNbr());
orgUsrDtos.forEach(orgUsrDto -> { orgUsrDtos.forEach(orgUsrDto -> {
......
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.lang.reflect.Field; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.LatentDangerFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlarmGiveStatisticsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
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.RestController;
import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.swing.plaf.basic.BasicViewportUI;
/** /**
* 警情接警记录 * 警情接警记录
...@@ -58,6 +68,10 @@ import javax.swing.plaf.basic.BasicViewportUI; ...@@ -58,6 +68,10 @@ import javax.swing.plaf.basic.BasicViewportUI;
public class AlertCalledController extends BaseController { public class AlertCalledController extends BaseController {
@Autowired @Autowired
LatentDangerFeignClient latentDangerFeignClient;
@Autowired
EquipFeignClient equipFeignClient;
@Autowired
AlertCalledServiceImpl iAlertCalledService; AlertCalledServiceImpl iAlertCalledService;
@Autowired @Autowired
AlertFormValueServiceImpl iAlertFormValueService; AlertFormValueServiceImpl iAlertFormValueService;
...@@ -362,9 +376,16 @@ public class AlertCalledController extends BaseController { ...@@ -362,9 +376,16 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAmosId", method = RequestMethod.GET) @RequestMapping(value = "/getAmosId", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询") @ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询")
public ResponseModel< List<Map<String,String>>> getContact ( ) { public ResponseModel< Object> getContact ( ) {
return ResponseHelper.buildResponse(iAlertCalledService.getContactName()); if (redisUtils.hasKey(RedisKey.CONTACT_USER)) {
Object obj = redisUtils.get(RedisKey.CONTACT_USER);
return ResponseHelper.buildResponse(obj);
} else {
List<Map<String, String>> contactName = iAlertCalledService.getContactName();
redisUtils.set(RedisKey.CONTACT_USER , contactName, time);
return ResponseHelper.buildResponse(contactName);
}
} }
/** /**
...@@ -382,4 +403,54 @@ public class AlertCalledController extends BaseController { ...@@ -382,4 +403,54 @@ public class AlertCalledController extends BaseController {
} }
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/ /*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/
/**
* 警情填报地址模糊查询
*
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAlarmGiveStatistics", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "app领导统计", notes = "app领导统计")
public ResponseModel<AlarmGiveStatisticsDto> getAlarmGiveStatistics () {
AlarmGiveStatisticsDto dto = new AlarmGiveStatisticsDto();
LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.isNull(AlertCalled::getFatherAlert);
queryWrapper.eq(AlertCalled::getAlertStatus,true);
queryWrapper.eq(AlertCalled::getIsDelete,false);
Integer alertNum = iAlertCalledService.getBaseMapper().selectCount(queryWrapper);
dto.setAlarmNum(alertNum);
ResponseModel<Map<String, Object>> fireAlarm = equipFeignClient.getFireAlarm();
Map<String, Object> map = fireAlarm.getResult();
int fireAlarmNum = !ValidationUtil.isEmpty(map.get("FireAlarmNum")) ? Integer.valueOf(map.get("FireAlarmNum").toString()) : 0;
ResponseModel<Map<String, Object>> faultAlarm = equipFeignClient.getFaultAlarm();
map = faultAlarm.getResult();
int faultAlarmNum = !ValidationUtil.isEmpty(map.get("FaultAlarmNum")) ? Integer.valueOf(map.get("FaultAlarmNum").toString()) : 0;
ResponseModel<Map<String, Object>> monitorEvent = equipFeignClient.getMonitorEvent();
map = monitorEvent.getResult();
int monitorEventNum = !ValidationUtil.isEmpty(map.get("monitorEventNum")) ? Integer.valueOf(map.get("monitorEventNum").toString()) : 0;
dto.setIotDetection(fireAlarmNum+faultAlarmNum+monitorEventNum);
ResponseModel<Object> currentHiddenDanger = latentDangerFeignClient.getUnFinishedDangerCount();
Integer currentHiddenDangerNum = (Integer) currentHiddenDanger.getResult();
dto.setCurrentHiddenDanger(currentHiddenDangerNum);
dto.setAllNum(dto.getAlarmNum()+dto.getIotDetection()+currentHiddenDangerNum);
return ResponseHelper.buildResponse(dto);
}
/**
* 获取坐席情况
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getLocation")
@ApiOperation(httpMethod = "GET", value = "模糊获取地址的方法", notes = "模糊获取地址的方法")
public ResponseModel<Object> getLocationLike(@RequestParam String locationt) {
return ResponseHelper.buildResponse(iAlertCalledService.getLocationLike(locationt));
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto; import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
...@@ -41,10 +43,25 @@ public class ExcelController extends BaseController { ...@@ -41,10 +43,25 @@ public class ExcelController extends BaseController {
@Autowired @Autowired
DataSourcesImpl dataSources; DataSourcesImpl dataSources;
@Autowired
RedisUtils redisUtils;
@Autowired
Sequence sequence;
private static final String NOT_DUTY = "休班"; private static final String NOT_DUTY = "休班";
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取上传excle文件是否成功")
@GetMapping("/get/template/isSuccess/{key}")
public ResponseModel<Object> getTemplateIsSuccess(HttpServletResponse response, @PathVariable(value = "key") String key) {
if (redisUtils.hasKey(key)) {
Object obj = redisUtils.get(key);
return ResponseHelper.buildResponse(obj);
}
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "下载模板") @ApiOperation(value = "下载模板")
...@@ -88,10 +105,13 @@ public class ExcelController extends BaseController { ...@@ -88,10 +105,13 @@ public class ExcelController extends BaseController {
@PostMapping("/upload/{type}") @PostMapping("/upload/{type}")
public ResponseModel<Object> upload(@RequestPart("file") MultipartFile multipartFile, @PathVariable(value = "type") String type) { public ResponseModel<Object> upload(@RequestPart("file") MultipartFile multipartFile, @PathVariable(value = "type") String type) {
try { try {
long uuid = sequence.nextId();
String uuidString = Long.toString(uuid);
redisUtils.set(uuidString, 0);
ExcelEnums excelEnums= ExcelEnums.getByKey(type); ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType()); ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonUpload(multipartFile, excelDto); excelService.commonUpload(multipartFile, excelDto,uuidString);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(uuidString);
} catch (RuntimeException e) { } catch (RuntimeException e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("文件格式不正确或excel 模板不匹配"); // BUG 2821 by litw 2021年9月16日 throw new BadRequest("文件格式不正确或excel 模板不匹配"); // BUG 2821 by litw 2021年9月16日
......
...@@ -5,6 +5,7 @@ import java.util.*; ...@@ -5,6 +5,7 @@ import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.entity.*; import com.yeejoin.amos.boot.module.jcs.api.entity.*;
...@@ -810,7 +811,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -810,7 +811,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/ /*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/
public List<Map<String,String>> getContactName() { public List<Map<String,String>> getContactName() {
List<Map<String,String>> firefightersName = firefightersService.getFirefightersName(); List<Map<String,String>> firefightersName = firefightersService.getFirefightersName();
firefightersName.forEach(r->{
String phone = r.get("phone");
phone = QRCodeUtil.generateQRCode()+"@"+phone;
r.put("phone",phone);
}
);
List<Map<String,String>> contactNames = alertCalledMapper.getContactName(); List<Map<String,String>> contactNames = alertCalledMapper.getContactName();
contactNames.forEach(r->{
String phone = r.get("phone");
phone = QRCodeUtil.generateQRCode()+"@"+phone;
r.put("phone",phone);
}
);
firefightersName.addAll(contactNames); firefightersName.addAll(contactNames);
return firefightersName; return firefightersName;
...@@ -824,4 +837,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -824,4 +837,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return keyAddress; return keyAddress;
} }
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/ /*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/
public List<Map<String, Object>> getLocationLike(String locationt) {
List<Map<String, Object>> orgUserLocation=alertCalledMapper.getOrgUserLocation(locationt);
List<Map<String, Object>> alertCalledLocation=alertCalledMapper.getAlertCalledLocation(locationt);
List<Map<String, Object>> keySiteLocation=alertCalledMapper.getKeySiteLocation(locationt);
List<Map<String, Object>> airportLocation= alertCalledMapper.getAirportLocation(locationt);
orgUserLocation.addAll(alertCalledLocation);
orgUserLocation.addAll(keySiteLocation);
orgUserLocation.addAll(airportLocation);
return orgUserLocation;
}
} }
...@@ -96,6 +96,7 @@ import org.apache.poi.xssf.usermodel.XSSFSheet; ...@@ -96,6 +96,7 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
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.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -196,7 +197,7 @@ public class ExcelServiceImpl { ...@@ -196,7 +197,7 @@ public class ExcelServiceImpl {
@Autowired @Autowired
DynamicFormInstanceServiceImpl dynamicFormInstanceService; DynamicFormInstanceServiceImpl dynamicFormInstanceService;
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException { public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl(); String url = excelDto.getClassUrl();
Class<?> clz = Class.forName(url); Class<?> clz = Class.forName(url);
...@@ -352,8 +353,8 @@ public class ExcelServiceImpl { ...@@ -352,8 +353,8 @@ public class ExcelServiceImpl {
break; break;
} }
} }
public void commonUpload(MultipartFile multipartFile, ExcelDto excelDto) throws Exception { public void commonUpload(MultipartFile multipartFile, ExcelDto excelDto,String uuidString) throws Exception {
switch (excelDto.getType()) { switch (excelDto.getType()) {
case "WHP": case "WHP":
...@@ -378,10 +379,10 @@ public class ExcelServiceImpl { ...@@ -378,10 +379,10 @@ public class ExcelServiceImpl {
excelImportFirefighters(multipartFile); excelImportFirefighters(multipartFile);
break; break;
case "CLZQ": case "CLZQ":
excelImportDutyPerson(multipartFile, "CLZQ"); excelImportDutyPerson(multipartFile, "CLZQ",uuidString);
break; break;
case "RYZB": case "RYZB":
excelImportDutyPerson(multipartFile, "RYZB"); excelImportDutyPerson(multipartFile, "RYZB",uuidString);
break; break;
case "WBRY": case "WBRY":
excelImportMaintenancePerson(multipartFile); excelImportMaintenancePerson(multipartFile);
...@@ -403,13 +404,13 @@ public class ExcelServiceImpl { ...@@ -403,13 +404,13 @@ public class ExcelServiceImpl {
excelImportLinkageUnitJYZBDto(multipartFile); excelImportLinkageUnitJYZBDto(multipartFile);
break; break;
case "WXXFZB": case "WXXFZB":
excelImportDutyPerson(multipartFile, "WXXFZB"); excelImportDutyPerson(multipartFile, "WXXFZB",uuidString);
break; break;
case "XFAQBG": case "XFAQBG":
excelImportSafeReport(multipartFile); excelImportSafeReport(multipartFile);
break; break;
case "JJZB": case "JJZB":
excelImportDutyPerson(multipartFile, "JJZB"); excelImportDutyPerson(multipartFile, "JJZB",uuidString);
break; break;
} }
return; return;
...@@ -999,10 +1000,22 @@ public class ExcelServiceImpl { ...@@ -999,10 +1000,22 @@ public class ExcelServiceImpl {
}); });
fireExpertsServiceImpl.saveBatch(excelEntityList); fireExpertsServiceImpl.saveBatch(excelEntityList);
} }
@Async
private void excelImportDutyPerson(MultipartFile multipartFile, String dutyType) throws Exception { private void excelImportDutyPerson(MultipartFile multipartFile, String dutyType,String uuidString) throws Exception {
try {
String fileName = multipartFile.getOriginalFilename(); ImportDutyPerson(multipartFile,dutyType);
if(redisUtils.hasKey(uuidString)){
redisUtils.set(uuidString, 1);
}
} catch (Exception e) {
if(redisUtils.hasKey(uuidString)){
redisUtils.set(uuidString, 2);
}
}
}
private void ImportDutyPerson(MultipartFile multipartFile, String dutyType) throws Exception {
String fileName = multipartFile.getOriginalFilename();
if (fileName == null) { if (fileName == null) {
throw new Exception("文件不存在!"); throw new Exception("文件不存在!");
} }
...@@ -1036,8 +1049,8 @@ public class ExcelServiceImpl { ...@@ -1036,8 +1049,8 @@ public class ExcelServiceImpl {
dutyFirstAidService.saveImportData(dataList); dutyFirstAidService.saveImportData(dataList);
} }
} }
}
}
private void initDutyFirstAidData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) { private void initDutyFirstAidData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) {
for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) {
DutyFirstAidDto dutyFirstAidDto = new DutyFirstAidDto(); DutyFirstAidDto dutyFirstAidDto = new DutyFirstAidDto();
...@@ -1128,6 +1141,10 @@ public class ExcelServiceImpl { ...@@ -1128,6 +1141,10 @@ public class ExcelServiceImpl {
if (row == null) { if (row == null) {
continue; continue;
} }
Cell cell4 = row.getCell(4);
if(cell4 ==null) {
continue;
}
Cell cell = row.getCell(1); Cell cell = row.getCell(1);
if (cell != null) { if (cell != null) {
String[] split = cell.toString().split("@"); String[] split = cell.toString().split("@");
...@@ -1184,6 +1201,10 @@ public class ExcelServiceImpl { ...@@ -1184,6 +1201,10 @@ public class ExcelServiceImpl {
if (row == null) { if (row == null) {
continue; continue;
} }
Cell cell4 = row.getCell(4);
if(cell4 ==null) {
continue;
}
Cell cell = row.getCell(1); Cell cell = row.getCell(1);
if (cell != null) { if (cell != null) {
dutyPersonDto.setUserId(cell.toString()); dutyPersonDto.setUserId(cell.toString());
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
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.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.base.Joiner; import com.itextpdf.text.Document;
import com.itextpdf.text.*; import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.BaseFont; import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfPTable;
import com.yeejoin.amos.boot.biz.common.utils.PdfUtils; import com.yeejoin.amos.boot.biz.common.utils.PdfUtils;
...@@ -18,26 +42,6 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.ShiftChangePowerDto; ...@@ -18,26 +42,6 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.ShiftChangePowerDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.ShiftChange; import com.yeejoin.amos.boot.module.jcs.api.entity.ShiftChange;
import com.yeejoin.amos.boot.module.jcs.api.mapper.ShiftChangeMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.ShiftChangeMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IShiftChangeService; import com.yeejoin.amos.boot.module.jcs.api.service.IShiftChangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import springfox.documentation.spring.web.json.Json;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/** /**
* 交接班记录表服务实现类 * 交接班记录表服务实现类
...@@ -59,7 +63,6 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha ...@@ -59,7 +63,6 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
@Override @Override
public Map<String, Object> createFormAndEntry(Map<String, Object> model) { public Map<String, Object> createFormAndEntry(Map<String, Object> model) {
Long instanceId = dynamicFormInstanceService.commonSave(GROUP_CODE, model); Long instanceId = dynamicFormInstanceService.commonSave(GROUP_CODE, model);
ShiftChange shiftChange = (ShiftChange) Bean.mapToBean(model, ShiftChange.class); ShiftChange shiftChange = (ShiftChange) Bean.mapToBean(model, ShiftChange.class);
shiftChange.setInstanceId(instanceId); shiftChange.setInstanceId(instanceId);
......
...@@ -369,4 +369,11 @@ public class LatentDangerController extends BaseController { ...@@ -369,4 +369,11 @@ public class LatentDangerController extends BaseController {
public ResponseModel getAllDangerState() { public ResponseModel getAllDangerState() {
return ResponseHelper.buildResponse((iLatentDangerService.getAllDangerState())); return ResponseHelper.buildResponse((iLatentDangerService.getAllDangerState()));
} }
@ApiOperation(value = "所有未完成隐患数量", notes = "所有未完成隐患数量")
@GetMapping(value = "/app/unFinished")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getUnFinishedDangerCount() {
return ResponseHelper.buildResponse((iLatentDangerService.getUnFinishedDangerCount()));
}
} }
...@@ -80,4 +80,6 @@ public interface LatentDangerMapper extends BaseMapper<LatentDanger> { ...@@ -80,4 +80,6 @@ public interface LatentDangerMapper extends BaseMapper<LatentDanger> {
* @return * @return
*/ */
IPage<LatentDanger> selectPageByParam(@Param("page") Page<LatentDanger> page, @Param("paramMap") Map<String, Object> paramMap); IPage<LatentDanger> selectPageByParam(@Param("page") Page<LatentDanger> page, @Param("paramMap") Map<String, Object> paramMap);
Integer selectUnFinishedCount(@Param("dangerState1") List<String> dangerState1, @Param("dangerState2") List<String> dangerState2);
} }
...@@ -2090,4 +2090,21 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2090,4 +2090,21 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
pageParam.put("bizType", bizType); pageParam.put("bizType", bizType);
return pageListDanger(pageParam); return pageListDanger(pageParam);
} }
@Override
public Integer getUnFinishedDangerCount() {
LambdaQueryWrapper<LatentDanger> queryWrapper = new LambdaQueryWrapper<>();
// 巡检隐患未关闭状态集合
List<LatentDangerState.PatrolDangerStateEnum> pDangerStateEnumList = Lists.newArrayList();
pDangerStateEnumList.add(LatentDangerState.PatrolDangerStateEnum.治理完毕);
pDangerStateEnumList.add(LatentDangerState.PatrolDangerStateEnum.待评审);
pDangerStateEnumList.add(LatentDangerState.PatrolDangerStateEnum.已撤销);
// 防火监督未关闭隐患状态集合
List<LatentDangerState.SupervisionDangerStateEnum> sDangerStateEnumList = Lists.newArrayList();
sDangerStateEnumList.addAll(LatentDangerState.SupervisionDangerStateEnum.getEnumListByProcessState(LatentDangerProcessStateEnum.未审核.getCode()));
sDangerStateEnumList.addAll(LatentDangerState.SupervisionDangerStateEnum.getEnumListByProcessState(LatentDangerProcessStateEnum.待审核.getCode()));
sDangerStateEnumList.addAll(LatentDangerState.SupervisionDangerStateEnum.getEnumListByProcessState(LatentDangerProcessStateEnum.治理完毕.getCode()));
return this.baseMapper.selectUnFinishedCount(pDangerStateEnumList.stream().map(LatentDangerState.PatrolDangerStateEnum::getCode).collect(Collectors.toList()), sDangerStateEnumList.stream().map(LatentDangerState.SupervisionDangerStateEnum::getCode).collect(Collectors.toList()));
}
} }
...@@ -166,4 +166,11 @@ public interface ILatentDangerService { ...@@ -166,4 +166,11 @@ public interface ILatentDangerService {
* @return * @return
*/ */
List<Map<String, String>> getAllDangerState(); List<Map<String, String>> getAllDangerState();
/**
* 获取所有未完成的隐患数量
*
* @return
*/
Integer getUnFinishedDangerCount();
} }
...@@ -86,4 +86,5 @@ spring.servlet.multipart.maxFileSize=3MB ...@@ -86,4 +86,5 @@ spring.servlet.multipart.maxFileSize=3MB
spring.servlet.multipart.maxRequestSize=3MB spring.servlet.multipart.maxRequestSize=3MB
supervision.feign.name=AMOS-SUPERVISION-API supervision.feign.name=AMOS-SUPERVISION-API
video.fegin.name=VIDEO888 video.fegin.name=VIDEO888
\ No newline at end of file latentDanger.feign.name=AMOS-LATENT-DANGER
\ No newline at end of file
...@@ -59,4 +59,5 @@ pagehelper.support-methods-arguments=true ...@@ -59,4 +59,5 @@ pagehelper.support-methods-arguments=true
feign.httpclient.connection-timeout=5000 feign.httpclient.connection-timeout=5000
video.fegin.name=video video.fegin.name=video
\ No newline at end of file latentDanger.feign.name=AMOS-LATENT-DANGER
\ No newline at end of file
...@@ -1027,4 +1027,26 @@ ...@@ -1027,4 +1027,26 @@
order by a.create_date desc order by a.create_date desc
</if> </if>
</select> </select>
<select id="selectUnFinishedCount" resultType="java.lang.Integer">
SELECT COUNT(1)
FROM p_latent_danger
WHERE deleted = 0
AND (
(biz_type = 'patrol'
<if test="dangerState1 != null and !dangerState1.isEmpty()">
AND danger_state NOT IN
<foreach collection="dangerState1" item="state" open="(" separator="," close=")">
#{state}
</foreach>
</if>
)
OR (biz_type = 'supervision'
<if test="dangerState2 != null and !dangerState2.isEmpty()">
AND danger_state NOT IN
<foreach collection="dangerState2" item="state" open="(" separator="," close=")">
#{state}
</foreach>
</if>
))
</select>
</mapper> </mapper>
\ No newline at end of file
spring.application.name = AMOS-PATROL spring.application.name = AMOS-PATROL-tb
server.servlet.context-path=/patrol server.servlet.context-path=/patrol
server.port = 8082 server.port = 8082
......
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